Sandbox.Gradient/ColorFrame Item { get; set; }

book_4_sparkGenerated
code_blocksInput

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

To use the Item property, you can access it using an indexer on a Gradient instance. This property is useful when you need to iterate over or modify specific color frames within the gradient.

Example

// Example of accessing the Item property
Gradient gradient = new Gradient();

// Access a specific ColorFrame by index
Gradient.ColorFrame colorFrame = gradient[0];

// Modify a specific ColorFrame
gradient[0] = new Gradient.ColorFrame { Time = 0.5f, Color = Color.Red };