RGBA to HSL
Convert your RGBA color format to HSL format.
About this tool
Type or paste an RGBA color, or choose one with the picker, and the converter shows it as HSL as you type, with a preview and every other format underneath, each with its own copy button. It reads colors written in any of the formats, and color names like “tomato”, too.
How to convert RGBA to HSL
RGBA already gives the red, green and blue channels, from 0 to 255, and alpha from 0 to 1. For HSL, divide each channel by 255 and take the largest and smallest of the three. The lightness is their average; the saturation is the gap between them, relative to the lightness; and the hue is an angle that depends on which channel is largest: red near 0, green near 120 and blue near 240.
HSL has no alpha, so the opacity is dropped and the color comes out fully solid.
The hue, saturation and lightness are rounded to whole numbers, so converting back can move a channel by one.
RGBA to HSL examples
| Color | RGBA | HSL |
|---|---|---|
| Sage green | rgba(168, 208, 141, 0.8) |
hsl(96, 42%, 68%) |
| Red | rgba(255, 0, 0, 0.8) |
hsl(0, 100%, 50%) |
| Tomato | rgba(255, 99, 71, 0.8) |
hsl(9, 100%, 64%) |
| Gold | rgba(255, 215, 0, 0.8) |
hsl(51, 100%, 50%) |
| Dodger blue | rgba(30, 144, 255, 0.8) |
hsl(210, 100%, 56%) |
| Indigo | rgba(75, 0, 130, 0.8) |
hsl(275, 100%, 25%) |
| Black | rgba(0, 0, 0, 0.8) |
hsl(0, 0%, 0%) |
| White | rgba(255, 255, 255, 0.8) |
hsl(0, 0%, 100%) |
What is RGBA?
RGBA adds alpha, the opacity, to RGB as a number from 0 (invisible) to 1 (solid). In current CSS, rgb() takes an alpha too, but rgba() still works everywhere and is the more familiar of the two.
What is HSL?
HSL describes a color by its hue (0 to 360 degrees on the color wheel), saturation and lightness. It’s easy to adjust by hand: keep the hue and change the lightness to get lighter and darker shades of the same color. CSS accepts it directly.