wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



_wp_tinycolor_bound_alpha › WordPress Function

Depuis5.9.0
Dépréciée6.3.0
_wp_tinycolor_bound_alpha ( $n )
Accès:
  • private
Paramètres:
  • (mixed) $n Number of unknown type.
    Requis: Oui
Liens:
Retourne:
  • (float) Value in the range [0,1].
Défini(e) dans:
Codex:

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



Source

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