You are here

private static function Kint_Parsers_Color::_HSLtoRGB in Devel 8.2

Same name and namespace in other branches
  1. 8 kint/kint/parsers/custom/color.php \Kint_Parsers_Color::_HSLtoRGB()
1 call to Kint_Parsers_Color::_HSLtoRGB()
Kint_Parsers_Color::_convert in kint/kint/parsers/custom/color.php

File

kint/kint/parsers/custom/color.php, line 183

Class

Kint_Parsers_Color

Code

private static function _HSLtoRGB(array $hsl) {
  list($h, $s, $l) = $hsl;
  $m2 = $l <= 0.5 ? $l * ($s + 1) : $l + $s - $l * $s;
  $m1 = $l * 2 - $m2;
  return array(
    round(self::_hue2rgb($m1, $m2, $h + 0.33333) * 255),
    round(self::_hue2rgb($m1, $m2, $h) * 255),
    round(self::_hue2rgb($m1, $m2, $h - 0.33333) * 255),
  );
}