CSS Colors

HSL

The HSL (hue, saturation and lightness) color model was designed in the 1970s with a goal of a more human intuitive color model which is more in line with how our eyes work.

The HSL color model mapped to a cylinder. [Image by Wikipedia/SharkD]
The HSL color model mapped to a cylinder. [Image by Wikipedia/SharkD]

Functional notation

HSL colors have only one notation: the functional notation. The functional notation uses the numbers between 0 and 360 to specify the angle of the color circle followed by two percentages between 0 and 100 for level of saturation and lightness.

h1 {
color: hsl(120, 50%, 100%);
}

We can also specify an optional alpha component that represents the color's transparency.

h1 {
color: hsla(120, 50%, 100%, 75%);
}

Read more on MDN

<color>: HSL colors

Test yourself

Description

Change the color of .movie-quote to

hsla(60, 75%, 50%, 0.9)

The rules have already been defined for you. You only need to add the proper declarations in the right places.

Tests

  1. 1 You should give the .movie-quote element the color specified in the description.
Editor
Preview