Gradients.ToGradientPalette

Extension Method in Gradients

Declaration

public static Color[] ToGradientPalette(this Color start, Color end, int stops)

Description

Creates a palette of colors by interpolating a linear amount of stops between a start color and end color.

Parameters

startThe start color of the gradient palette.
endThe end color of the gradient palette.
stopsThe amount of stops to interpolate between the start and end color.

Returns

Color[]The colors of the gradient palette.

Overload

Declaration

public static Color[] ToGradientPalette(this Color start, Color end, float[] stops)

Description

Creates a palette of colors by evaluating a predefined array of stops between a start color and end color. The number of colors generated is determined by the amount of stops.

Parameters

startThe start color of the gradient palette.
endThe end color of the gradient palette.
stopsThe array of stops to evaluate between the start and end color.

Returns

Color[]The colors of the gradient palette.