How to convert HSL to RGB
- Enter hue from 0 to 360, saturation from 0 to 100 and lightness from 0 to 100.
- Click Convert.
- Read the RGB values, and the HEX code if you need it for CSS.
How the conversion works
The chroma is C = (1 - |2L - 1|) x S. The hue picks which two channels get color, a secondary value X = C x (1 - |(H / 60) mod 2 - 1|) fills the middle channel, and m = L - C / 2 is added to every channel before scaling to 0-255.
Example: hsl(210, 100%, 50%) becomes rgb(0, 128, 255).
Good to know
- A hue of 360 is the same as 0.
- Saturation 0 gives a shade of gray, no matter the hue.
- Values outside the valid range are limited to it.
Frequently Asked Questions
Why do I get a gray color?
With saturation at 0, every hue gives gray. Increase the saturation to get color.
Is the result rounded?
Yes. RGB channels are rounded to whole numbers from 0 to 255.
More Color Converters