Dynamic Color Ramp

This is a group that creates a dynamic color ramp, with the possibility of setting the position of 3 color stops and the color of each color stop.
Input values color2,color3,color4 are associated with color stops f1,f2,f3. Color1 and color5 are the color at the edges of the color ramp.
Each interval [0 , f1] [f1 , f2] [f2 , f3] [f3 , 1] is mapped to the interval [0 , 1]. Once this is done, the new value becomes the input factor of a mix color node, which decides the color between the 2 colors that delimit each interval [0 , f1] [f1 , f2] [f2 , f3] [f3 , 1].
Then, based on the input f value, the right color is chosen among the 4 calculated colors.
In the image,the ramp color node (with RGB color mode and linear interpolation) and the dynamic color ramp node give the same results.
If you want less than 3 color stops,change the color of the color stop you don’t need,to the same color as the previous or next color stop.Then set its position to the position of the other color stop.


The file is
dynamic_color_ramp.zip (438.4 KB)

3 Likes