Colour Ramp
Four colours along 0 to 1, at the stops you set.
ƒColour Ramp
Position0
Colour 1
Colour 2
Colour 3
Colour 4
Position 20.33
Position 30.66
InterpolationSmooth
Inputs
| Pin | Type | Starts at | Notes |
|---|---|---|---|
Positionat | float | 0 | – |
Colour 1colour1 | vec3 | "#0b2a3a" | – |
Colour 2colour2 | vec3 | "#3fd0c9" | – |
Colour 3colour3 | vec3 | "#caecff" | – |
Colour 4colour4 | vec3 | "#ffffff" | – |
Position 2stop2 | float | 0.33 | – |
Position 3stop3 | float | 0.66 | – |
Interpolationmode | choice | Smooth | One of: Smooth, Steps, OKLab. |
Outputs
| Pin | Type |
|---|---|
out | vec3 |
The code it becomes
What Studio writes for the graph below: a few lines of the material's shader, worked out for every pixel.
void mainImage(out vec4 fragColor, in vec2 fragCoord){ vec3 n2_out = (clamp(0.0, 0.0, 1.0) < 0.33 ? mix(vec3(0.04314, 0.16471, 0.22745), vec3(0.24706, 0.81569, 0.78824), clamp((clamp(0.0, 0.0, 1.0) - 0.0) / max(0.33 - 0.0, 1e-5), 0.0, 1.0)) : clamp(0.0, 0.0, 1.0) < 0.66 ? mix(vec3(0.24706, 0.81569, 0.78824), vec3(0.79216, 0.92549, 1.0), clamp((clamp(0.0, 0.0, 1.0) - 0.33) / max(0.66 - 0.33, 1e-5), 0.0, 1.0)) : mix(vec3(0.79216, 0.92549, 1.0), vec3(1.0, 1.0, 1.0), clamp((clamp(0.0, 0.0, 1.0) - 0.66) / max(1.0 - 0.66, 1e-5), 0.0, 1.0))); fragColor = vec4(n2_out, 1.0);}In a graph
ƒColour Ramp
Position0
Colour 1
Colour 2
Colour 3
Colour 4
Position 20.33
Position 30.66
InterpolationSmooth
◎Material OutputEnds here
Colour
Alpha1
Texture coordinates into the node, and the node into the material, as Studio draws them.
Related
Notes from the community
Written by creators and checked by the docs' editors. Not part of Motion's official reference.