Gradients.ToGradient
Extension Method in Gradients
Declaration
public static Gradient ToGradient(this GradientColorKey[] colors, GradientAlphaKey[] alpha)
Description
Creates a new gradient and sets the given color keys and alpha keys.
Parameters
colors | The color keys to set on the gradient. |
alpha | The alpha keys to set on the gradient. |
Returns
Gradient | The new gradient. |
Overload
Declaration
public static Gradient ToGradient(this GradientColorKey[] colors, float alpha = 1F)
Description
Creates a new gradient and sets the given color keys with a constant alpha value for the entire gradient.
Parameters
colors | The color keys to set on the gradient. |
alpha | The alpha value to set for the entire gradient [0..1] (default=1). |
Returns
Gradient | The new gradient. |
Overload
Declaration
public static Gradient ToGradient(this Color start, Color end)
Description
Creates a new gradient with a given start color and end color.
Parameters
start | The start color of the gradient. |
end | The end color of the gradient. |
Returns
Gradient | The new gradient. |
Overload
Declaration
public static Gradient ToGradient(this Color start, Color end, int stops)
Description
Creates a new gradient that interpolates a linear amount of stops between a start color and end color.
Parameters
start | The start color of the gradient. |
end | The end color of the gradient. |
stops | The amount of stops to interpolate between the start and end color. |
Returns
Gradient | The new gradient. |
Overload
Declaration
public static Gradient ToGradient(this Color start, Color end, float[] stops)
Description
Creates a new gradient that distributes a predefined array of stops between a start color and end color.
Parameters
start | The start color of the gradient. |
end | The end color of the gradient. |
stops | The array of stops to distribute between the start and end color. |
Returns
Gradient | The new gradient. |
Overload
Declaration
public static Gradient ToGradient(this Color start, params Color[] stops)
Description
Creates a new gradient with the given colors evenly distributed throughout.
Parameters
start | The start color of the gradient. |
stops | The remaining colors of the gradient. |
Returns
Gradient | The new gradient. |
Overload
Declaration
public static Gradient ToGradient(this Color[] colors)
Description
Creates a new gradient with the given colors evenly distributed throughout.
Parameters
colors | The colors of the gradient. |
Returns
Gradient | The new gradient. |
Overload
Declaration
public static Gradient ToGradient(this Color[] colors, float[] stops)
Description
Creates a new gradient with the given colors distributed with a predefined array of stops.
Parameters
colors | The colors of the gradient. |
stops | The array of stops to distribute for each color of the gradient. |
Returns
Gradient | The new gradient. |