Lines Matching +full:red +full:- +full:x
8 * @license GPL 3 (https://www.gnu.org/licenses/gpl-3.0.en.html)
34 $this->hue = $hue;
35 $this->saturation = $saturation;
36 $this->lightness = $lightness;
47 return $this->lightness;
52 return $this->saturation;
57 return $this->hue;
68 $this->lightness = $int;
83 $lightness = $this->lightness / 100;
84 $saturation = $this->saturation / 100;
85 $hue = $this->hue;
87 $chroma = (1 - abs(2 * $lightness - 1)) * $saturation;
88 $x = $chroma * (1 - abs(fmod(($hue / 60), 2) - 1));
89 $m = $lightness - ($chroma / 2);
92 $red = $chroma;
93 $green = $x;
96 $red = $x;
100 $red = 0;
102 $blue = $x;
104 $red = 0;
105 $green = $x;
108 $red = $x;
112 $red = $chroma;
114 $blue = $x;
117 $red = ($red + $m) * 255;
126 intval(round($red)),
147 $this->saturation = $saturation;
154 $this->hue += ($this->hue > 180) ? -180 : 180;
160 return "hsl($this->hue deg, $this->saturation%, $this->lightness%)";
165 if ($this->lightness - $lightness < 0) {
166 $this->lightness = 0;
168 $this->lightness -= $lightness;
178 $color = $color->toHsl();
182 "h" => round($this->getHue() - $color->getHue(), 2),
183 "s" => round($this->getSaturation() - $color->getSaturation(), 2),
184 "l" => round($this->getLightness() - $color->getLightness(), 2),