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

gradientThe gradient to get the colors from.
evaluateAlphaWhether 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

gradientThe gradient to interpolate.
stopsThe number of stops to interpolate in the gradient.
evaluateAlphaWhether 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

gradientThe gradient to interpolate.
stopsThe array of stops to evaluate each color in the gradient.
evaluateAlphaWhether to evaluate the alpha values of the gradient (default=true).

Returns

Color[]The colors of the gradient.