Clamps an array of RGBA values.
Direct port of colord’s clampRgba function.
$rgbaarrayrequired
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;
}
| 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_rgba