1 call to CSSmin::rgbToHex()
- CSSmin::hslToHex in advagg_css_compress/
yui/ CSSMin.inc
File
-
advagg_css_compress/
yui/ CSSMin.inc, line 1011
Class
Code
private function rgbToHex($matches) {
$hexColors = array();
$rgbColors = explode(',', $matches[1]);
// Values outside the sRGB color space should be clipped (0-255)
for ($i = 0, $l = count($rgbColors); $i < $l; $i++) {
$hexColors[$i] = sprintf("%02x", $this->clampNumberSrgb($this->rgbPercentageToRgbInteger($rgbColors[$i])));
}
// Fix for issue #2528093
if (!preg_match('/[\\s,);}]/', $matches[2])) {
$matches[2] = ' ' . $matches[2];
}
return '#' . implode('', $hexColors) . $matches[2];
}