Color Ramp

Recolors a texture by mapping one of its channels onto a gradient between two colors.

Outputs

NameTypeDescription
Texture OutputTextureThe recolored texture.

Inputs

NameTypeDescription
Texture InputTextureThe texture whose channel drives the gradient.

Parameters

NameTypeDescription
Output FormatEnumWhether the output takes the size and type of the input or uses the settings below.Choices: Copy Input, Manual
Texture TypeEnumThe channels of the output texture. Follows the input unless the output format is Manual.Choices: R (u8), RG (u8), RGBA (u8)
Texture SizeVector 2 IntThe size of the output texture in pixels. Follows the input unless the output format is Manual.
ChannelEnumWhich channel of the input picks the position on the gradient.Choices: Red, Green, Blue, Alpha
Color SpaceEnumThe color space the gradient is blended in, which changes the colors in between.Choices: RGB, HSV, HSL, OKLab
Color AColorThe color where the channel is 0.
Color BColorThe color where the channel is 1.

Color Ramp paints a texture with a gradient. For every pixel it reads one channel of the input and uses the value as a position between two colors: 0 gives Color A, 1 gives Color B and anything in between gives a mix. A gray texture from Noise or Sine Wave becomes a colored one this way, and a black-to-white gradient becomes any two-color gradient.

The color space decides what the colors between the two ends look like. RGB blends the numbers directly, which can pass through dull grays between two bright colors. HSV and HSL blend around the color wheel, taking the shorter way around, so a blend from red to blue goes through purple. OKLab blends the way the eye sees it, with even steps in lightness and no dull middle, and is the best choice for most gradients. The alpha of the two colors is always blended in a straight line.

Keywords: gradient, colorize, tint, map, palette, lut, heat map