Gradients.ToColors
Extension Method in Gradients
Declaration
public static Color[] ToColors(this Gradient gradient, bool evaluateAlpha = true)Description
Returns the colors of a gradient.
Parameters
| gradient | The gradient to get the colors from. |
| evaluateAlpha | Whether to evaluate the alpha values of the gradient (default=true). |
Returns
| Color[] | The colors of the gradient. |
Overload
Declaration
public static Color[] ToColors(this Gradient gradient, int stops, bool evaluateAlpha = true)Description
Returns the colors of a gradient by interpolating a linear amount of stops within the gradient.
Parameters
| gradient | The gradient to interpolate. |
| stops | The number of stops to interpolate in the gradient. |
| evaluateAlpha | Whether to evaluate the alpha values of the gradient (default=true). |
Returns
| Color[] | The colors of the gradient. |
Overload
Declaration
public static Color[] ToColors(this Gradient gradient, float[] stops, bool evaluateAlpha = true)Description
Returns the colors of a gradient by evaluating a predefined array of stops.
Parameters
| gradient | The gradient to interpolate. |
| stops | The array of stops to evaluate each color in the gradient. |
| evaluateAlpha | Whether to evaluate the alpha values of the gradient (default=true). |
Returns
| Color[] | The colors of the gradient. |