Colors on CSS3

Color formats in CSS2

  • Hex format – #cccccc
  • Shorthand hex format – #ccc
  • rgb() format – rgb (red, green, blue)
  • Named colors – white, red, blue, etc

New color formats in CSS3

  • HSL – hsl(hue, saturation, lightness)
  • CMYK – cmyk(cyan, magenta, yellow, black)
  • HSLA – hsla(hue, saturation, lightness, alpha)
  • RGBA – rgba(red, green, blue, alpha)

HSL

  • HSL stands for Hue, Saturation, Lightness
  • A format that is easier for humans to understand and manipulate
  • HSLA – hsla(hue, saturation, lightness, alpha)