You are here

private function CSSmin::hue_to_rgb in Advanced CSS/JS Aggregation 8.3

Same name and namespace in other branches
  1. 8.2 advagg_css_minify/yui/CSSMin.inc \CSSmin::hue_to_rgb()
  2. 6 advagg_css_compress/yui/CSSMin.inc \CSSmin::hue_to_rgb()
1 call to CSSmin::hue_to_rgb()
CSSmin::hsl_to_hex in advagg_css_minify/yui/CSSMin.inc

File

advagg_css_minify/yui/CSSMin.inc, line 703

Class

CSSmin

Code

private function hue_to_rgb($v1, $v2, $vh) {
  $vh = $vh < 0 ? $vh + 1 : ($vh > 1 ? $vh - 1 : $vh);
  if ($vh * 6 < 1) {
    return $v1 + ($v2 - $v1) * 6 * $vh;
  }
  if ($vh * 2 < 1) {
    return $v2;
  }
  if ($vh * 3 < 2) {
    return $v1 + ($v2 - $v1) * (2 / 3 - $vh) * 6;
  }
  return $v1;
}