- Home
- Tools
- Color & Design
- Color Converter
- RGB to HSL Converter
RGB to HSL Converter
Convert red, green and blue values to hue, saturation and lightness, the form that is easiest to adjust by eye.
The numbers alone will do: 255, 99, 71.
In HSL
hsl(38.8, 100%, 50%)
Hue
39°Alpha
100%
In the other notations
Name
orangeexact match
RGB to HSL by hand
The converter opens with rgb(255, 165, 0). This is how that color gets from RGB to HSL, step by step.
- Divide each value by 255, so that it runs from 0 to 1: 255 ÷ 255 = 1, 165 ÷ 255 = 0.6471 and 0 ÷ 255 = 0.
- The largest of the three is 1 and the smallest 0. Lightness is halfway between them: (1 + 0) ÷ 2 = 0.5, or 50%.
- Saturation is the gap between those two, 1 − 0 = 1, as a share of the most this lightness leaves room for, 1 − |2 × 0.5 − 1| = 1: 1 ÷ 1 = 1, or 100%.
- Red is the largest, so the hue is 60° × (green − blue) ÷ gap = 60° × (0.6471 − 0) ÷ 1 = 38.83°.
- With one decimal at most:
hsl(38.8, 100%, 50%).
Well-known colors in RGB and HSL
| Color | RGB | HSL |
|---|---|---|
| black | rgb(0, 0, 0) | hsl(0, 0%, 0%) |
| white | rgb(255, 255, 255) | hsl(0, 0%, 100%) |
| gray | rgb(128, 128, 128) | hsl(0, 0%, 50.2%) |
| red | rgb(255, 0, 0) | hsl(0, 100%, 50%) |
| orange | rgb(255, 165, 0) | hsl(38.8, 100%, 50%) |
| yellow | rgb(255, 255, 0) | hsl(60, 100%, 50%) |
| lime | rgb(0, 255, 0) | hsl(120, 100%, 50%) |
| green | rgb(0, 128, 0) | hsl(120, 100%, 25.1%) |
| cyan | rgb(0, 255, 255) | hsl(180, 100%, 50%) |
| blue | rgb(0, 0, 255) | hsl(240, 100%, 50%) |
| purple | rgb(128, 0, 128) | hsl(300, 100%, 25.1%) |
| magenta | rgb(255, 0, 255) | hsl(300, 100%, 50%) |
Reading the result
- The hue is a position on the color wheel: 0° is red, 120° green and 240° blue. This orange, at 38.8°, lies between red and yellow, which is at 60°.
- Saturation says how far a color is from gray, measured against the most its lightness allows. Close to black or white that can be 100% for a color that looks almost gray:
rgb(2, 0, 0)has a saturation of 100%. - When the three values are equal the color is a gray. Its saturation is 0% and its hue is written as 0.
- From here a color is easy to change: turn the hue for another color, lower the saturation to gray it, move the lightness for a tint or a shade.
The color converter shows a color in all seven notations at once, with a picker to choose it by eye.