Clamps a number between a minimum and a maximum value.
Parameters
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 in advagg_css_compress/
yui/ CSSMin.inc - Clamps a RGB color number outside the sRGB color space
- CSSmin::hslToRgb in advagg_css_compress/
yui/ CSSMin.inc - Converts a HSL color into a RGB color
File
-
advagg_css_compress/
yui/ CSSMin.inc, line 1084
Class
Code
private function clampNumber($n, $min, $max) {
return min(max($n, $min), $max);
}