CSS HSL Colors
- Previous Page CSS HEX Colors
- Next Page CSS Background
HSL value
In CSS, color can be specified using hue, saturation, and lightness (HSL) as follows:
hsla(hue, saturation, lightness)
Hue (hue)is the degrees from 0 to 360 on the color wheel. 0 is red, 120 is green, and 240 is blue.
Saturation (saturation)is a percentage value, 0% represents grey shadow, while 100% is full color.
Brightness (lightness)is also a percentage, 0% is black, 50% is neither bright nor dark, and 100% is white.
Please experiment by mixing the following HSL values:
HUE
SATURATION
LIGHTNESS
Example
Saturation
Saturation can be described as the intensity of the color.
100% is pure color, without any grey shadow
50% is 50% grey, but you can still see the color.
0% is completely grey, and you can no longer see any color.
Example
Brightness
The brightness of the color can be described as how much light is to be given to the color, where 0% represents not bright (black), 50% represents 50% bright (neither dark nor bright), and 100% represents fully bright (white).
Example
Grey shadows are usually defined by setting the hue and saturation to 0, and adjusting the brightness from 0% to 100% to get darker/lighter shadows:
Example
HSLA value
The HSLA color value is an extension of the HSL color value with an Alpha channel - it specifies the opacity of the color.
The HSLA color value is specified as:
hsla(hue, saturation, lightness, alpha)
alpha The parameters are numbers between 0.0 (completely transparent) and 1.0 (completely opaque):
Please experiment by mixing the following HSLA values:
HUE
SATURATION
LIGHTNESS
ALPHA
Example
- Previous Page CSS HEX Colors
- Next Page CSS Background