Gradients.ToGradientPaletteNonAlloc

Extension Method in Gradients

Declaration

public static void ToGradientPaletteNonAlloc(this Color start, Color end, Color[] output)

Description

Creates a palette of colors by interpolating a linear amount of stops between a start color and end color. The number of colors generated is determined by the size of the array. The colors are stored in an existing array to prevent heap allocations.

Parameters

startThe start color of the gradient palette.
endThe end color of the gradient palette.
outputThe output array to store the colors in.

Overload

Declaration

public static void ToGradientPaletteNonAlloc(this Color start, Color end, float[] stops, Color[] output)

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. The colors are stored in an existing array to prevent heap allocations.

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.
outputThe output array to store the colors in.