private function hueToPoint(float $p, float $q, float $t): float
    {
        if ($t < 0) {
            $t += 1;
        }

        if ($t > 1) {
            $t -= 1;
        }

        switch (true) {
            case $t < 1 / 6:
                return $p + ($q - $p) * 6 * $t;

            case $t < 1 / 2:
                return $q;

            case $t < 2 / 3:
                return $p + ($q - $p) * (2 / 3 - $t) * 6;
        }

        return $p;
    }
private function hueToPoint(float $p, float $q, float $t): float
    {
        if ($t < 0) {
            $t += 1;
        }

        if ($t > 1) {
            $t -= 1;
        }

        switch (true) {
            case $t < 1 / 6:
                return $p + ($q - $p) * 6 * $t;

            case $t < 1 / 2:
                return $q;

            case $t < 2 / 3:
                return $p + ($q - $p) * (2 / 3 - $t) * 6;
        }

        return $p;
    }
private function hueToPoint ( float $ p , float $ q , float $ t ) : float { if ( $ t < 0 ) { $ t += 1 ; } if ( $ t > 1 ) { $ t -= 1 ; } switch ( true ) { case $ t < 1 / 6 : return $ p + ( $ q - $ p ) * 6 * $ t ; case $ t < 1 / 2 : return $ q ; case $ t < 2 / 3 : return $ p + ( $ q - $ p ) * ( 2 / 3 - $ t ) * 6 ; } return $ p ; }
Formula taken from the internet, don't know what it means

@param float $p Don't know what it represents
@param float $q Don't know what it represents
@param float $t Don't know what it represents

@return float
Formula taken from the internet don t know what it means