HSL to RGB

Hue picks a point on the colour wheel, then saturation and lightness scale toward grey, white or black.

Hue
Alpha
100%
RGB
rgb(66 135 245)

Paste a HSL value — other formats work too.

Need every format at once? Open in the full picker

Worked examples

Common colours converted from HSL to RGB, computed with the same engine the picker uses.

ColourHSLRGBCopy
Pure redhsl(0 100% 50%)rgb(255 0 0)
Pure greenhsl(120 100% 50%)rgb(0 255 0)
Pure bluehsl(240 100% 50%)rgb(0 0 255)
Whitehsl(300 100% 100%)rgb(255 255 255)
Mid greyhsl(300 0% 50.2%)rgb(128 128 128)
Blackhsl(0 0% 0%)rgb(0 0 0)
Interface bluehsl(216.9 89.9% 61%)rgb(66 135 245)
Success greenhsl(142.1 70.6% 45.3%)rgb(34 197 94)
Danger redhsl(0 84.2% 60.2%)rgb(239 68 68)
Warning amberhsl(37.7 92.1% 50.2%)rgb(245 158 11)
Editor blackhsl(0 0% 11.8%)rgb(30 30 30)
Warm sandhsl(42.5 74.3% 66.5%)rgb(233 196 106)

How the conversion works

Hue picks a point on the colour wheel, then saturation and lightness scale toward grey, white or black.

Both formats are computed from a single canonical representation — CIE XYZ with a D65 white point, held in floating point — rather than by chaining one format into the next. That matters because chained conversions accumulate rounding error, and because it means a colour that cannot be represented in the target format is handled deliberately rather than by accident.

When the source describes a colour outside the target's gamut, chroma is reduced in OKLCh while lightness and hue are held, following the CSS Color 4 gamut mapping algorithm. Clipping each channel independently would be simpler but visibly shifts hue on saturated colours.

Related conversions