public static function SassScriptFunctions::desaturate in Sassy 7
Same name and namespace in other branches
- 7.3 phpsass/script/SassScriptFunctions.php \SassScriptFunctions::desaturate()
 
* Makes a colour less saturated. *
Parameters
SassColour The colour to desaturate: * @param SassNumber The amount to desaturate the colour by * @param 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 new SassColour The desaturateed colour * @throws SassScriptFunctionException If $colour is not a colour or * $amount is not a number * @see adjust
2 calls to SassScriptFunctions::desaturate()
- SassScriptFunctions::grayscale in phamlp/
sass/ script/ SassScriptFunctions.php  - * Greyscale for non-english speakers. *
 - SassScriptFunctions::greyscale in phamlp/
sass/ script/ SassScriptFunctions.php  - * Converts a colour to greyscale. * Reduces the saturation to zero. *
 
File
- phamlp/
sass/ script/ SassScriptFunctions.php, line 347  
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, '%');
}