Method: Sass::Script::Functions#darken

Defined in:
lib/sass/script/functions.rb

#darken($color, $amount) ⇒ Color

Makes a color darker. Takes a color and a number between 0% and 100%, and returns a color with the lightness decreased by that amount.

Examples:

darken(hsl(25, 100%, 80%), 30%) => hsl(25, 100%, 50%)
darken(#800, 20%) => #200

Parameters:

  • $color (Color)
  • $amount (Number)

    The amount to dencrease the lightness by, between 0% and 100%

Returns:

Raises:

  • (ArgumentError)

    if $amount is out of bounds, or either parameter is the wrong type

See Also:



711
712
713
# File 'lib/sass/script/functions.rb', line 711

def darken(color, amount)
  _adjust(color, amount, :lightness, 0..100, :-, "%")
end