Skip to content
ColorsGuide

HSL to RGB converter

Enter a HSL value such as hsl(173 58% 39%) to convert it to RGB. Every other format is shown too, and the result updates as you type.

Example paletteUsed until you create or choose your own

Detected HSL.

Examples: #1e90ff, rgb(30 144 255 / 50%), hsl(210 100% 56%), oklch(0.65 0.18 255), cmyk(88% 44% 0% 0%), tomato

Name
Soft sea green(descriptive)
Alpha
100%
Relative luminance
0.2665
Perceived lightness (OKLCH L)
63.1%
Contrast on white
3.32:1
Contrast on black
6.33:1

See shades, harmonies and palettes for #2A9D90

Converted values

  • HEX#2a9d90
  • RGBrgb(42 157 144)
  • HSLhsl(173 58% 39%)
  • HSV / HSBhsv(173 73.4% 61.6%)
  • HWBhwb(173 16.4% 38.4%)
  • OKLCHoklch(63.09% 0.1013 183.49)
  • OKLABoklab(63.09% -0.1011 -0.0062)
  • CIELABlab(58.42% -35.14 -2.58)
  • CMYKcmyk(73% 0% 9% 38%)

CMYK is a naive, device-independent approximation. Real print colours depend on the ink, paper and ICC profile your printer uses, so ask your printer for a proofed conversion. HSV/HSB is not a CSS format and is shown for design apps. CIELAB uses the D50 white point, as in CSS lab().

How to convert HSL to RGB

  1. Normalise saturation and lightness to 0–1.
  2. Compute chroma C = (1 − |2L − 1|) × S and X = C × (1 − |(H ÷ 60) mod 2 − 1|).
  3. Assign C, X and 0 to red, green and blue according to the hue's 60° sector.
  4. Add m = L − C/2 to each channel and multiply by 255.

About HSL

HSL describes a colour as a hue angle (0–360°), saturation and lightness. It is easy to adjust by hand, but its lightness is not perceptual: a yellow and a blue at 50% lightness look very different in brightness.

About RGB

RGB gives the same three sRGB channels as decimal numbers from 0 to 255 (or 0–100%). Modern CSS writes rgb(255 87 51 / 50%) with spaces and a slash before the alpha; the older comma form rgba(255, 87, 51, 0.5) still works everywhere.

Examples

SwatchHSLRGB
hsl(0 0% 100%)rgb(255 255 255)
hsl(0 0% 0%)rgb(0 0 0)
hsl(0 100% 50%)rgb(255 0 0)
hsl(158.2 100% 32.9%)rgb(0 168 107)
hsl(209.6 100% 55.9%)rgb(30 144 255)
hsl(50.6 100% 50%)rgb(255 215 0)
hsl(300 100% 25.1%)rgb(128 0 128)
hsl(16.1 100% 65.7%)rgb(255 127 80)
hsl(210 12.6% 50.2%)rgb(112 128 144)
hsl(60 55.6% 91.2%)rgb(245 245 220)
hsl(197.3 37.2% 23.7%)rgb(38 70 83)
hsl(12 75.8% 61.2%)rgb(231 111 81)

Other conversions

Was this page useful?