Processes and clamps a degree (angle) value properly.
Description
Direct port of colord’s clampHue function.
Parameters
$degrees
floatrequired- The hue to clamp.
Source
private static function colord_clamp_hue( $degrees ) {
$degrees = is_finite( $degrees ) ? $degrees % 360 : 0;
return $degrees > 0 ? $degrees : $degrees + 360;
}
Changelog
Version | Description |
---|---|
6.3.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.