HSL Color Space


HSL color space

HSL (Hue Saturation Lightness) color space is a human way to represent color values in computer systems. The main idea was to present a color model in a more intuitive approach. Typically it used for most color pickers UIs.

There is one more color model that has quite the same logic called HSV(HSB).

HSL has three dimensions that use to define the exact color. Geometry interpretation of it is a cylinder. Where the central axis is neural achromatic colors.

HUE [0-360]

The main dimension is Hue that can be presented as a color circle with values from 0 to 360. Where 0 is solid Red color, 120 mean pure green value and 240 mean blue.

Check the respective HSL color codes below.


The second axis has a range between 0 and 100 percent. It gives Hue color a gray shade. 0 - is a pure gray color, and 100 is a Hue color itself, without any shades.

Check the respective HSL color codes below.


The last axis has the same range as the previous 0-100%. Obviously, it means a value of light in color. 0 - is no light at all or black color, 100 - is the max value of light - white. In the middle of it (50) a canonical Hue value.

Check the respective HSL color codes below.


HSL function is supported by all major modern browsers, including IE9. It was added in CSS3 specification.

Color HSLA

HSLA is an extended way to define a color. There is an additional axis added called alpha.

Alpha makes hsl transparent in the range [0-1]. Which means 0 - completely transparent, 1 - no transparency at all.

Basic Syntax

hsl(hue, saturation, lightness)
hsla(hue, saturation, lightness, alpha)

CSS Examples

.selector { background-color: hsl(0, 0%, 0%); } /* black background color */
/* shades */
.selector { color: hsl(0, 100%, 50%); } /* hue red */
.selector { color: hsl(0, 100%, 75%); } /* light red */
.selector { color: hsl(0, 100%, 25%); } /* dark red */
.selector { color: hsl(0, 60%, 70%); } /* pastel red */
.selector { color: hsla(0, 100%, 50%, 0.5); } /* hue red with alpha */