WP_Duotone::colord_clamp_hsla( array $hsla ): array

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Clamps an array of HSLA values.

Description

Direct port of colord’s clampHsla function.

Parameters

$hslaarrayrequired
The HSLA array to clamp.

Return

array The clamped HSLA array.

Source

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;
}

Changelog

VersionDescription
6.3.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.