_color_hsl2rgb

_color_hsl2rgb($hsl)

Converts an HSL triplet into RGB.

File

core/modules/color/color.module, line 780
Allows users to change the color scheme of themes.

Code

function _color_hsl2rgb($hsl) {
  $h = $hsl[0];
  $s = $hsl[1];
  $l = $hsl[2];
  $m2 = ($l <= 0.5) ? $l * ($s + 1) : $l + $s - $l * $s;
  $m1 = $l * 2 - $m2;

  return array(
    _color_hue2rgb($m1, $m2, $h + 0.33333),
    _color_hue2rgb($m1, $m2, $h),
    _color_hue2rgb($m1, $m2, $h - 0.33333),
  );
}
doc_Drupal
2016-10-29 09:57:06
Comments
Leave a Comment

Please login to continue.