You are here

public static function SassScriptFunctions::opacify in Sassy 7

Same name and namespace in other branches
  1. 7.3 phpsass/script/SassScriptFunctions.php \SassScriptFunctions::opacify()

* Makes a colour more opaque. *

Parameters

SassColour The colour to opacify: * @param 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 new SassColour The opacified colour * @throws SassScriptFunctionException If $colour is not a colour or * $amount is not a number * @see opacify_rel

1 call to SassScriptFunctions::opacify()
SassScriptFunctions::fade_in in phamlp/sass/script/SassScriptFunctions.php
* Makes a colour more opaque. * Alias for {@link opacify}. *

File

phamlp/sass/script/SassScriptFunctions.php, line 365

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);
}