You are here

public static function SassScriptFunctions::transparentize in Sassy 7.3

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

Makes a colour more transparent.

Parameters

SassColour The colour to transparentize:

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 value

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 phpsass/script/SassScriptFunctions.php
Makes a colour more transparent. Alias for {@link transparentize}.

File

phpsass/script/SassScriptFunctions.php, line 390

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