wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



_wp_tinycolor_bound_alpha › WordPress Function

Od5.9.0
Przestarzały6.3.0
_wp_tinycolor_bound_alpha ( $n )
Dostęp:
  • private
Parametry:
  • (mixed) $n Number of unknown type.
    Wymagane: Tak
Linki:
Powrót:
  • (float) Value in the range [0,1].
Zdefiniowane na:
Codex:

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



Źródło

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