WP_Duotone::colord_clamp_hue()private staticWP 6.3.0

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() code WP 6.5.3

private static function colord_clamp_hue( $degrees ) {
	$degrees = is_finite( $degrees ) ? $degrees % 360 : 0;
	return $degrees > 0 ? $degrees : $degrees + 360;
}