wp_tinycolor_hue_to_rgb()
Deprecated since 6.3.0. It is no longer supported and may be removed in future releases. It is recommended to replace this function with the same one.
Helper function for hsl to rgb conversion.
Direct port of TinyColor's function, lightly simplified to maintain consistency with TinyColor.
Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.
No Hooks.
Returns
float. R, G, or B component.
Usage
wp_tinycolor_hue_to_rgb( $p, $q, $t );
- $p(float) (required)
- first component.
- $q(float) (required)
- second component.
- $t(float) (required)
- third component.
Changelog
| Since 5.8.0 | Introduced. |
| Deprecated since | 6.3.0 |
wp_tinycolor_hue_to_rgb() wp tinycolor hue to rgb code WP 6.8.3
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;
}