You are here

public static function SassScriptFunctions::darken in Sassy 7.3

Same name and namespace in other branches
  1. 7 phamlp/sass/script/SassScriptFunctions.php \SassScriptFunctions::darken()

Makes a colour darker.

Parameters

SassColour The colour to darken:

SassNumber The amount to darken the colour by:

SassBoolean Whether the amount is a proportion of the current value: (true) or the total range (false). The default is false - the amount is a proportion of the total range. If the colour lightness value is 80% and the amount is 50%, the resulting colour lightness value is 30% if the amount is a proportion of the total range, whereas it is 40% if the amount is a proportion of the current value.

Return value

new SassColour The darkened colour

Throws

SassScriptFunctionException If $colour is not a colour or $amount is not a number

See also

adjust

File

phpsass/script/SassScriptFunctions.php, line 314

Class

SassScriptFunctions
SassScript functions class. A collection of functions for use in SassSCript. @package PHamlP @subpackage Sass.script

Code

public static function darken($colour, $amount, $ofCurrent = false) {
  return self::adjust($colour, $amount, $ofCurrent, 'lightness', self::DECREASE, 0, 100, '%');
}