W3cubDocs

/WordPress

WP_Duotone::colord_clamp_hue( float $degrees ): float

Processes and clamps a degree (angle) value properly.

Description

Direct port of colord’s clampHue function.

Parameters

$degreesfloatrequired
The hue to clamp.

Return

float The clamped hue.

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.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_duotone/colord_clamp_hue