You are here

public static function SassScriptFunctions::saturate in Sassy 7.3

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

Makes a colour more saturated.

Parameters

SassColour The colour to saturate:

SassNumber The amount to saturate 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 40% and the amount is 50%, the resulting colour saturation value is 90% if the amount is a proportion of the total range, whereas it is 60% if the amount is a proportion of the current value.

Return value

new SassColour The saturated colour

Throws

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

See also

adjust

File

phpsass/script/SassScriptFunctions.php, line 334

Class

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

Code

public static function saturate($colour, $amount, $ofCurrent = false) {
  return self::adjust($colour, $amount, $ofCurrent, 'saturation', self::INCREASE, 0, 100, '%');
}