WP_Duotone::colord_clamp_hsla()private staticWP 6.3.0

Clamps an array of HSLA values.

Direct port of colord's clampHsla function.

Method of the class: WP_Duotone{}

No Hooks.

Return

Array. The clamped HSLA array.

Usage

$result = WP_Duotone::colord_clamp_hsla( $hsla );
$hsla(array) (required)
The HSLA array to clamp.

Changelog

Since 6.3.0 Introduced.

WP_Duotone::colord_clamp_hsla() code WP 6.7.1

private static function colord_clamp_hsla( $hsla ) {
	$hsla['h'] = self::colord_clamp_hue( $hsla['h'] );
	$hsla['s'] = self::colord_clamp( $hsla['s'], 0, 100 );
	$hsla['l'] = self::colord_clamp( $hsla['l'], 0, 100 );
	$hsla['a'] = self::colord_clamp( $hsla['a'] );

	return $hsla;
}