CSS: HSL Color

By Xah Lee. Date: . Last updated: .

Random Color Generator

(click the button to see a random color)

HSL Color Syntax

hsl(hue, saturation%, lightness%)

Example:

span.xyz {color:hsl( 0, 100%, 50%)}

HSL Color Examples

Changing Hue

Changing Saturation

Changing Lightness

Lightness goes from black to white.

See also: CSS: Opacity.

Reference

CSS Color Module Level 3

CSS Color Topic

  1. CSS Color Tutorial
  2. CSS Color Names
  3. CSS: HSL Color
  4. CSS: Linear Gradient
  5. CSS: Radial Gradient
  6. CSS: Opacity
Like what you read? Buy JavaScript in Depth
or, buy a new keyboard, see Keyboard Reviews.