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

Darken

  • Dark
    Light
  • PDF

Returns the color with the lightness component decreased by a percentage, given as a decimal number between 0 and 1.

Function signature

DARKEN(color: String, darknesspercentage: Number) => String
Parameter Description
Color Color
Darkness percentage Percentage to increase darkness (0...1)

Examples

Formula Return value
DARKEN("#fff", 0.5) rgb(128,128,128)
DARKEN("rgb(10, 20, 40)", 0.5) rgb(0,0,0)
DARKEN("hsl(80, 20%, 40%)", 0.3) rgb(27,31,21)
DARKEN("red", 0.2) rgb(153,0,0)

Was this article helpful?

What's Next