_wp_tinycolor_bound_alpha

函数


_wp_tinycolor_bound_alpha ( $n )
Access
Private
参数
  • (mixed)
    $n
    Number of unknown type.
    Required:
返回值
  • (float) Value in the range [0,1].
相关
  • https://github.com/bgrins/TinyColor
定义位置
  • wp-includes/block-supports/duotone.php
    , line 83
引入
5.9.0
弃用

Direct port of tinycolor’s boundAlpha function to maintain consistency with
how tinycolor works.

function _wp_tinycolor_bound_alpha( $n ) {
	if ( is_numeric( $n ) ) {
		$n = (float) $n;
		if ( $n >= 0 && $n