private static function normalizeHue($hue) 
    {
        if (!is_numeric($hue)) {
            throw new \InvalidArgumentException(
                "'$hue' is not a valid hue.");
        }

        $hue = $hue % 360;
        if ($hue < 0) {
            $hue += 360;
        }

        return $hue;
    }
private static function normalizeHue($hue) 
    {
        if (!is_numeric($hue)) {
            throw new \InvalidArgumentException(
                "'$hue' is not a valid hue.");
        }

        $hue = $hue % 360;
        if ($hue < 0) {
            $hue += 360;
        }

        return $hue;
    }
private static function normalizeHue ( $ hue ) { if ( ! is_numeric ( $ hue ) ) { throw new \ InvalidArgumentException ( "'$hue' is not a valid hue." ) ; } $ hue = $ hue % 360 ; if ( $ hue < 0 ) { $ hue += 360 ; } return $ hue ; }
Normalizes a hue to the first turn [0, 360).

@param mixed $hue
@return integer
Normalizes a hue to the first turn [ 0 360 ) .