book_4_sparkGenerated
code_blocksInput

Description

The Alphas property of the Gradient struct in the Sandbox namespace provides a list of alpha stops, which are used to define the transparency levels at specific points in time within a gradient. These alpha stops should be ordered by time to ensure the gradient is rendered correctly.

Usage

Use the Alphas property to access or manipulate the list of alpha frames in a gradient. Each alpha frame specifies a transparency level at a particular time, allowing for smooth transitions between different transparency levels in a gradient effect.

Example

// Example of accessing the Alphas property
Gradient gradient = new Gradient();
ImmutableList<Gradient.AlphaFrame> alphaFrames = gradient.Alphas;

// Iterate through the alpha frames
foreach (var alphaFrame in alphaFrames)
{
    float time = alphaFrame.Time;
    float alpha = alphaFrame.Alpha;
    // Use time and alpha as needed
}