WP_Duotone::colord_clamp_rgba( array $rgba ): 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 RGBA values.

Description

Direct port of colord’s clampRgba function.

Parameters

$rgbaarrayrequired
The RGBA array to clamp.

Return

array The clamped RGBA array.

Source

private static function colord_clamp_rgba( $rgba ) {
	$rgba['r'] = self::colord_clamp( $rgba['r'], 0, 255 );
	$rgba['g'] = self::colord_clamp( $rgba['g'], 0, 255 );
	$rgba['b'] = self::colord_clamp( $rgba['b'], 0, 255 );
	$rgba['a'] = self::colord_clamp( $rgba['a'] );

	return $rgba;
}

Changelog

VersionDescription
6.3.0Introduced.

User Contributed Notes

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