public static function SassScriptFunctions::desaturate in Sassy 7.3
Same name and namespace in other branches
- 7 phamlp/sass/script/SassScriptFunctions.php \SassScriptFunctions::desaturate()
Makes a colour less saturated.
Parameters
SassColour The colour to desaturate:
SassNumber The amount to desaturate 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 saturation value is 80% and the amount is 50%, the resulting colour saturation 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 desaturateed colour
Throws
SassScriptFunctionException If $colour is not a colour or $amount is not a number
See also
adjust
2 calls to SassScriptFunctions::desaturate()
- SassScriptFunctions::grayscale in phpsass/
script/ SassScriptFunctions.php - Greyscale for non-english speakers.
- SassScriptFunctions::greyscale in phpsass/
script/ SassScriptFunctions.php - Converts a colour to greyscale. Reduces the saturation to zero.
File
- phpsass/
script/ SassScriptFunctions.php, line 354
Class
- SassScriptFunctions
- SassScript functions class. A collection of functions for use in SassSCript. @package PHamlP @subpackage Sass.script
Code
public static function desaturate($colour, $amount, $ofCurrent = false) {
return self::adjust($colour, $amount, $ofCurrent, 'saturation', self::DECREASE, 0, 100, '%');
}