You are here

public static function SassScriptFunctions::transparentize in Sassy 7

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

* Makes a colour more transparent. *

Parameters

SassColour The colour to transparentize: * @param SassNumber The amount to transparentize 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.8 * if the amount is 0.5 the resulting colour alpha value is 0.3, * whereas if the amount is 50% the resulting colour alpha value is 0.4. * @return new SassColour The transparentized colour * @throws SassScriptFunctionException If $colour is not a colour or * $amount is not a number

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

File

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

Class

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

Code

public static function transparentize($colour, $amount, $ofCurrent = false) {
  $units = self::units($amount);
  return self::adjust($colour, $amount, $ofCurrent, 'alpha', self::DECREASE, 0, $units === '%' ? 100 : 1, $units);
}