wpseek.com
WordPress开发者和主题制作者的搜索引擎



_wp_tinycolor_bound_alpha › WordPress Function

Since5.9.0
已弃用6.3.0
_wp_tinycolor_bound_alpha ( $n )
访问:
  • private
参数:
  • (mixed) $n Number of unknown type.
    Required: Yes
链接:
返回:
  • (float) Value in the range [0,1].
定义在:
文档:

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



源码

function _wp_tinycolor_bound_alpha( $n ) {
	_deprecated_function( __FUNCTION__, '6.3.0' );

	if ( is_numeric( $n ) ) {
		$n = (float) $n;
		if ( $n >= 0 && $n <= 1 ) {
			return $n;
		}
	}
	return 1;
}