Result
All calculations run locally in your browser: parsing, chart, export. Disconnect the network and the page keeps working.
Facts and limits of this method
| Hue (H) | Wrapped modulo 360 — accepts any number |
|---|---|
| Saturation and lightness | Clamped to the 0% to 100% range |
| Result range | Each R/G/B channel is a whole number from 0 to 255 |
| Formula | Standard HSL → RGB algorithm via hue2rgb helper functions |
When it misleads you
- A hue outside the 0–360 range isn't treated as an error — it wraps modulo 360, since the color wheel is cyclical.
- Saturation and lightness outside the 0–100% range are automatically clamped to those values.
- The result is rounded to whole R/G/B values — converting back to HSL afterward can show a fraction-of-a-percent deviation because of this rounding.
- At 0% saturation, the result is always gray (R=G=B) regardless of the hue entered — that's a mathematical property of the HSL model, not a calculation error.
How it is calculated
Hue is wrapped into the 0–360° range and divided by 360; saturation and lightness are converted from percentages to fractions from 0 to 1.
Two helper values are computed from lightness and saturation, defining the brightness bounds for the current hue.
For each of the three channels (red, green, blue), a point on the color wheel is sampled, offset by a third of a turn relative to the hue — this gives three fractions from 0 to 1.
Each fraction is converted to the 0–255 range and rounded to a whole number — these are the final R, G and B values.
Questions and answers
What if I enter a hue above 360?
It's automatically wrapped modulo 360 — 400°, for example, is equivalent to 40°, since the color wheel is cyclical.
Why is the result always gray at 0% saturation?
That's a mathematical property of the HSL model: at zero saturation, hue has no effect, and all three RGB channels become equal to each other.
Will the result match if I convert it back to HSL?
Almost always, but rounding RGB to whole numbers can produce a fraction-of-a-percent deviation from the original saturation and lightness values.
Is my data sent anywhere?
No, the whole calculation runs in your browser.