颜色渐变节点

颜色渐变节点。

The Color Ramp Node is used for mapping values to colors using a gradient.

输入

系数

The value to map. 0.0 results in the leftmost color, while 1.0 results in the rightmost.

属性

渐变色

参见 颜色渐变部件

输出

图像/颜色

标准颜色输出。

Alpha

标准化遮罩输出。

示例

Alpha遮罩

An often overlooked use case of the Color Ramp is to turn a black-and-white image into a colored image with transparency.

../../../_images/compositing_types_converter_color-ramp_create-alpha-mask.png

In the example above, a black-and-white swirl image, which is lacking an alpha channel, is fed into the Color Ramp node as a Factor.

The Color Ramp node is set to a purely transparent color on the left end of the gradient, and a fully red color on the right. As you can see in the Viewer node, the Color Ramp node outputs an image that is transparent where the input is black, and opaque where the input is white.

彩色化图像

在此示例中,将多种颜色添加到颜色渐变中,从而将黑白图像转换为火焰状漩涡。

../../../_images/compositing_types_converter_color-ramp_colorizing-image.png

输入图像中的灰色阴影映射为三种颜色:蓝色、黄色和红色,全部完全不透明。在图像为黑色的情况下,颜色渐变将替换为蓝色(第一个色标)。如果是灰色阴影,则 “颜色渐变” 会从渐变中输出相应的颜色(蓝色、黄色到红色)。在图像为全白的情况下,颜色渐变输出为红色。