Description
The Item
property of the Gradient
struct provides access to a specific ColorFrame
within the gradient. This property allows you to retrieve or modify a color frame at a given index, enabling fine-grained control over the gradient's color transitions.
Usage
Use the Item
property to access or modify a ColorFrame
in a Gradient
object. This property is typically used in conjunction with an index to specify which color frame to access.
Example
// Example of accessing a ColorFrame using the Item property
Gradient gradient = new Gradient();
ColorFrame colorFrame = gradient.Item[0]; // Access the first ColorFrame
// Example of modifying a ColorFrame using the Item property
ColorFrame newColorFrame = new ColorFrame { Time = 0.5f, Color = Color.Red };
gradient.Item[0] = newColorFrame; // Modify the first ColorFrame