◆ ConvertToTexture()

static Texture2D ConvertToTexture ( this Gradient  gradientToTexturize,
int  textureWidth,
bool  appendReverseGradient = true 
)
static
Parameters
gradientToTexturizegradient to be evaluated for each horizontal pixel in the output texture.
textureWidthdefines how many pixels will be in the output texture, and how many steps in the gradient will be evaluated.
appendReverseGradientWhen true, the full gradient will only take up half the width of the texture, the second half of the texture will contains the gradient colors in reverse order. This will ensure the starting pixel is the same color as the ending pixel, regardless of the gradient used.
Returns
A Texture, 3 pixels in height, with the colors of the gradient spanning the horizontal pixels.