mx_hsvtorgb
Converts a color defined in the HSV (Hue, Saturation, Value) space back into the RGB color space required by renderers and displays.
Core Advantages
Common Uses
Creating rainbow or dynamic color-shifting effects by mapping UV coordinates or time to the hue component.
In data visualization, mapping data values like temperature or pressure to easily distinguishable colors.
As the final step in a color grading workflow, converting the adjusted HSV color back to RGB.
How to adjust
Precisely control the output color by independently adjusting the input H, S, and V components. Changing H (Hue) cycles through the color spectrum (a rainbow effect); changing S (Saturation) controls the color's vividness (from grayscale to pure color); changing V (Value) controls the color's brightness (from black to a bright color).
Code Examples
1// Use the UV's x-coordinate as hue to create a rainbow gradient
2const hsvColor = vec3( uv().x, 1.0, 1.0 );
3
4// Convert the generated HSV color to RGB
5const rgbColor = mx_hsvtorgb( hsvColor );