wp_tinycolor_rgb_to_rgb

函数


wp_tinycolor_rgb_to_rgb ( $rgb_color )
Access
Private
参数
  • (array)
    $rgb_color
    RGB object.
    Required:
返回值
  • (array) Rounded and converted RGB object.
相关
  • https://github.com/bgrins/TinyColor
定义位置
  • wp-includes/block-supports/duotone.php
    , line 107
引入
5.8.0
弃用

Rounds and converts values of an RGB object.

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

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