You are here

public static function SassScriptFunctions::adjust_hue in Sassy 7.3

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

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

Parameters

SassColour The colour to adjust:

SassNumber The amount to adjust the colour by:

Return value

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 phpsass/script/SassScriptFunctions.php
Returns the complement of a colour. Rotates the hue by 180 degrees.

File

phpsass/script/SassScriptFunctions.php, line 272

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