wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_tinycolor_rgb_to_rgb › WordPress Function

Since5.8.0
Deprecatedn/a
wp_tinycolor_rgb_to_rgb ( $rgb_color )
Access:
  • private
Parameters:
  • (array) $rgb_color RGB object.
    Required: Yes
See:
Returns:
  • (array) Rounded and converted RGB object.
Defined at:
Codex:

Round and convert values of an RGB object.

Direct port of TinyColor's function, lightly simplified to maintain consistency with TinyColor.


Source

function wp_tinycolor_rgb_to_rgb( $rgb_color ) {
	return array(
		'r' => wp_tinycolor_bound01( $rgb_color['r'], 255 ) * 255,
		'g' => wp_tinycolor_bound01( $rgb_color['g'], 255 ) * 255,
		'b' => wp_tinycolor_bound01( $rgb_color['b'], 255 ) * 255,
	);
}