public static function SassScriptFunctions::opacify in Sassy 7.3
Same name and namespace in other branches
- 7 phamlp/sass/script/SassScriptFunctions.php \SassScriptFunctions::opacify()
Makes a colour more opaque.
Parameters
SassColour The colour to opacify:
SassNumber The amount to opacify the colour by: If this is a unitless number between 0 and 1 the adjustment is absolute, if it is a percentage the adjustment is relative. If the colour alpha value is 0.4 if the amount is 0.5 the resulting colour alpha value is 0.9, whereas if the amount is 50% the resulting colour alpha value is 0.6.
Return value
new SassColour The opacified colour
Throws
SassScriptFunctionException If $colour is not a colour or $amount is not a number
See also
opacify_rel
1 call to SassScriptFunctions::opacify()
- SassScriptFunctions::fade_in in phpsass/
script/ SassScriptFunctions.php - Makes a colour more opaque. Alias for {@link opacify}.
File
- phpsass/
script/ SassScriptFunctions.php, line 372
Class
- SassScriptFunctions
- SassScript functions class. A collection of functions for use in SassSCript. @package PHamlP @subpackage Sass.script
Code
public static function opacify($colour, $amount, $ofCurrent = false) {
$units = self::units($amount);
return self::adjust($colour, $amount, $ofCurrent, 'alpha', self::INCREASE, 0, $units === '%' ? 100 : 1, $units);
}