You are here

public static function SassScriptFunctions::adjust_hue in Sassy 7

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

* Changes the hue of a colour while retaining the lightness and saturation. *

Parameters

SassColour The colour to adjust: * @param SassNumber The amount to adjust the colour by * @return new SassColour The adjusted colour * @throws SassScriptFunctionException If $colour is not a colour or * $degrees is not a number

1 call to SassScriptFunctions::adjust_hue()
SassScriptFunctions::complement in phamlp/sass/script/SassScriptFunctions.php
* Returns the complement of a colour. * Rotates the hue by 180 degrees. *

File

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

Class

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

Code

public static function adjust_hue($colour, $degrees) {
  SassLiteral::assertType($colour, 'SassColour');
  SassLiteral::assertType($degrees, 'SassNumber');
  return $colour
    ->with(array(
    'hue' => $colour->hue + $degrees->value,
  ));
}