diff --git a/script/SassScriptFunctions.php b/script/SassScriptFunctions.php index fc0d4f0..fcbadcf 100755 --- a/script/SassScriptFunctions.php +++ b/script/SassScriptFunctions.php @@ -235,6 +235,7 @@ public static function hue($colour) return new SassNumber($colour->getHue() . 'deg'); } + /** * Returns the saturation component of a colour. * @param SassColour $colour The colour @@ -522,8 +523,16 @@ public static function complement($colour) * @see desaturate */ public static function grayscale($colour) - { - return self::desaturate($colour, new SassNumber(100)); + { + if(ctype_xdigit($colour)) + { + return self::desaturate($colour, new SassNumber(100)); + } + else + { + return ""; + } + } /**