SassColour::hue2rgb PHP Method

hue2rgb() public method

Converts from hue to RGB colourspace
public hue2rgb ( $p, $q, $t )
    public function hue2rgb($p, $q, $t)
    {
        if ($t < 0) {
            $t += 1;
        }
        if ($t > 1) {
            $t -= 1;
        }
        if ($t < 1 / 6) {
            $p = $p + ($q - $p) * 6 * $t;
        } else {
            if ($t < 1 / 2) {
                $p = $q;
            } else {
                if ($t < 2 / 3) {
                    $p = $p + ($q - $p) * (2 / 3 - $t) * 6;
                }
            }
        }
        return str_replace(',', '.', round($p * 255));
    }