Clamps a number between a minimum and a maximum value.

Paramètres

int|float $n the number to clamp:

int|float $min the lower end number allowed:

int|float $max the higher end number allowed:

Return value

int|float

2 calls to CSSmin::clampNumber()
CSSmin::clampNumberSrgb dans advagg_css_compress/yui/CSSMin.inc
Clamps a RGB color number outside the sRGB color space
CSSmin::hslToRgb dans advagg_css_compress/yui/CSSMin.inc
Converts a HSL color into a RGB color

Fichier

advagg_css_compress/yui/CSSMin.inc, line 1084

Classe

CSSmin

Code

private function clampNumber($n, $min, $max) {
    return min(max($n, $min), $max);
}