wp_tinycolor_hue_to_rgb( float $p, float $q, float $t ): float

This function has been deprecated.

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Helper function for hsl to rgb conversion.

Description

Direct port of TinyColor’s function, lightly simplified to maintain consistency with TinyColor.

Parameters

$pfloatrequired
first component.
$qfloatrequired
second component.
$tfloatrequired
third component.

Return

float R, G, or B component.

Source

function wp_tinycolor_hue_to_rgb( $p, $q, $t ) {
	_deprecated_function( __FUNCTION__, '6.3.0' );

	if ( $t < 0 ) {
		++$t;
	}
	if ( $t > 1 ) {
		--$t;
	}
	if ( $t < 1 / 6 ) {
		return $p + ( $q - $p ) * 6 * $t;
	}
	if ( $t < 1 / 2 ) {
		return $q;
	}
	if ( $t < 2 / 3 ) {
		return $p + ( $q - $p ) * ( 2 / 3 - $t ) * 6;
	}
	return $p;
}

Changelog

VersionDescription
6.3.0This function has been deprecated.
5.8.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.