GamutDesk Logo
GamutDesk

HSL to RGB Technical Converter

Transform cylindrical HSL components (C, X, m) into decimal RGB channels with detailed intermediate variable inspection.

Client-Side ArchitecturePrivate Client-Side Processing
HSL Cylindrical Input Coordinates
Hue (0° - 360°)
Saturation (0% - 100%)
Lightness (0% - 100%)
Chroma (C)0.780
Factor (X)0.247
Baseline (m)0.140
Generated RGB
rgb(36, 99, 235)
CSS RGB String
rgb(36, 99, 235)
Red (R)36
Green (G)99
Blue (B)235

Technical Specification & Mathematical Principles

Chroma is calculated as C = (1 - |2L - 1|) * S, followed by secondary component X = C * (1 - |(H / 60) mod 2 - 1|) and lightness baseline m = L - C / 2.

The resulting piecewise vectors (R', G', B') are translated by m and multiplied by 255 to yield physical screen channel bytes.

Frequently Asked Questions

What do the intermediate variables C, X, and m represent?
C represents chroma (colorfulness). X represents the intermediate secondary color component along the piecewise hexcone face, and m represents the lightness matching offset added to all three channels.
How does the 60-degree sector branching work?
The 360° circle is divided into six 60° sectors (Red-Yellow, Yellow-Green, Green-Cyan, Cyan-Blue, Blue-Magenta, Magenta-Red). The sector dictates which channel receives C, which receives X, and which receives 0 before adding m.
Are there rounding differences between floating-point and 8-bit integer RGB?
Yes, mathematical RGB channels produce continuous floating-point numbers between 0.0 and 255.0. Digital hardware quantizes these via `Math.round()` into discrete 8-bit integer integers (0-255).

Related Design & Color Instruments