Lightness
  • 18 May 2022
  • 1 Minute to read
  • Dark
    Light
  • PDF

Lightness

  • Dark
    Light
  • PDF

Returns an integer between 0 and 1 representing the hue component of the color.

Function signature

LIGHTNESS(color: String) => Number
Parameter Description
Color Color

Examples

Formula Return value
LIGHTNESS("#ff0") 0.5
LIGHTNESS("rgb(10, 20, 40)") 0.09803922
LIGHTNESS("hsl(80, 20%, 40%)") 0.4
LIGHTNESS("red") 0.5

Was this article helpful?

What's Next