WP_Duotone::colord_clamp_hue()
Processes and clamps a degree (angle) value properly.
Direct port of colord's clampHue function.
Method of the class: WP_Duotone{}
No Hooks.
Return
float
. The clamped hue.
Usage
$result = WP_Duotone::colord_clamp_hue( $degrees );
- $degrees(float) (required)
- The hue to clamp.
Changelog
Since 6.3.0 | Introduced. |
WP_Duotone::colord_clamp_hue() WP Duotone::colord clamp hue code WP 6.7.1
private static function colord_clamp_hue( $degrees ) { $degrees = is_finite( $degrees ) ? $degrees % 360 : 0; return $degrees > 0 ? $degrees : $degrees + 360; }