wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



_wp_tinycolor_bound_alpha › WordPress Function

Da5.9.0
Deprecato6.3.0
› _wp_tinycolor_bound_alpha ( $n )
Accedi:
  • private
Parametri:
  • (mixed) $n Number of unknown type.
    Richiesto: Sì
Links:
Ritorna:
  • (float) Value in the range [0,1].
Definito a:
Codex:

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



Sorgenti

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