@@ -339,7 +339,7 @@  | 
                                                    ||
| 339 | 339 | */  | 
                                                        
| 340 | 340 | private function requireValidComponent(string $name) : void  | 
                                                        
| 341 | 341 |      { | 
                                                        
| 342 | - if(in_array($name, self::COLOR_COMPONENTS))  | 
                                                        |
| 342 | + if (in_array($name, self::COLOR_COMPONENTS))  | 
                                                        |
| 343 | 343 |          { | 
                                                        
| 344 | 344 | return;  | 
                                                        
| 345 | 345 | }  | 
                                                        
@@ -48,7 +48,7 @@ discard block  | 
                                                    ||
| 48 | 48 | */  | 
                                                        
| 49 | 49 | public static function getPresetsManager() : PresetsManager  | 
                                                        
| 50 | 50 |      { | 
                                                        
| 51 | - if(!isset(self::$presets))  | 
                                                        |
| 51 | + if (!isset(self::$presets))  | 
                                                        |
| 52 | 52 |          { | 
                                                        
| 53 | 53 | self::$presets = new PresetsManager();  | 
                                                        
| 54 | 54 | }  | 
                                                        
@@ -64,7 +64,7 @@ discard block  | 
                                                    ||
| 64 | 64 | * @param string $name  | 
                                                        
| 65 | 65 | * @return RGBAColor  | 
                                                        
| 66 | 66 | */  | 
                                                        
| 67 | - public static function create(ColorChannel $red, ColorChannel $green, ColorChannel $blue, ?ColorChannel $alpha=null, string $name='') : RGBAColor  | 
                                                        |
| 67 | + public static function create(ColorChannel $red, ColorChannel $green, ColorChannel $blue, ?ColorChannel $alpha = null, string $name = '') : RGBAColor  | 
                                                        |
| 68 | 68 |      { | 
                                                        
| 69 | 69 | return new RGBAColor($red, $green, $blue, $alpha, $name);  | 
                                                        
| 70 | 70 | }  | 
                                                        
@@ -88,31 +88,31 @@ discard block  | 
                                                    ||
| 88 | 88 | */  | 
                                                        
| 89 | 89 | public static function createAuto($subject) : ?RGBAColor  | 
                                                        
| 90 | 90 |      { | 
                                                        
| 91 | - if($subject instanceof RGBAColor)  | 
                                                        |
| 91 | + if ($subject instanceof RGBAColor)  | 
                                                        |
| 92 | 92 |          { | 
                                                        
| 93 | 93 | return $subject;  | 
                                                        
| 94 | 94 | }  | 
                                                        
| 95 | 95 | |
| 96 | - if(is_array($subject))  | 
                                                        |
| 96 | + if (is_array($subject))  | 
                                                        |
| 97 | 97 |          { | 
                                                        
| 98 | 98 | return self::createFrom8BitArray($subject);  | 
                                                        
| 99 | 99 | }  | 
                                                        
| 100 | 100 | |
| 101 | 101 | $hexOrPreset = (string)$subject;  | 
                                                        
| 102 | 102 | |
| 103 | - if($hexOrPreset === '')  | 
                                                        |
| 103 | + if ($hexOrPreset === '')  | 
                                                        |
| 104 | 104 |          { | 
                                                        
| 105 | 105 | return null;  | 
                                                        
| 106 | 106 | }  | 
                                                        
| 107 | 107 | |
| 108 | 108 | $manager = self::getPresetsManager();  | 
                                                        
| 109 | 109 | |
| 110 | - if($manager->hasPreset($hexOrPreset))  | 
                                                        |
| 110 | + if ($manager->hasPreset($hexOrPreset))  | 
                                                        |
| 111 | 111 |          { | 
                                                        
| 112 | 112 | return $manager->getPreset($hexOrPreset);  | 
                                                        
| 113 | 113 | }  | 
                                                        
| 114 | 114 | |
| 115 | -        if(preg_match('/[a-f0-9]{3,8}/i', $hexOrPreset)) | 
                                                        |
| 115 | +        if (preg_match('/[a-f0-9]{3,8}/i', $hexOrPreset)) | 
                                                        |
| 116 | 116 |          { | 
                                                        
| 117 | 117 | return self::createFromHEX($hexOrPreset);  | 
                                                        
| 118 | 118 | }  | 
                                                        
@@ -160,7 +160,7 @@ discard block  | 
                                                    ||
| 160 | 160 |      { | 
                                                        
| 161 | 161 | $color = FormatsConverter::array2associative($color);  | 
                                                        
| 162 | 162 | |
| 163 | - if(!isset($color[RGBAColor::CHANNEL_ALPHA]))  | 
                                                        |
| 163 | + if (!isset($color[RGBAColor::CHANNEL_ALPHA]))  | 
                                                        |
| 164 | 164 |          { | 
                                                        
| 165 | 165 | $color[RGBAColor::CHANNEL_ALPHA] = 0;  | 
                                                        
| 166 | 166 | }  | 
                                                        
@@ -185,7 +185,7 @@ discard block  | 
                                                    ||
| 185 | 185 | * @see RGBAColor::ERROR_INVALID_COLOR_COMPONENT  | 
                                                        
| 186 | 186 | * @see RGBAColor::ERROR_INVALID_PERCENTAGE_VALUE  | 
                                                        
| 187 | 187 | */  | 
                                                        
| 188 | - public static function createFromHEX(string $hex, string $name='') : RGBAColor  | 
                                                        |
| 188 | + public static function createFromHEX(string $hex, string $name = '') : RGBAColor  | 
                                                        |
| 189 | 189 |      { | 
                                                        
| 190 | 190 | return FormatsConverter::hex2color($hex, $name);  | 
                                                        
| 191 | 191 | }  | 
                                                        
@@ -210,7 +210,7 @@ discard block  | 
                                                    ||
| 210 | 210 | * @param string $name  | 
                                                        
| 211 | 211 | * @return RGBAColor  | 
                                                        
| 212 | 212 | */  | 
                                                        
| 213 | - public static function createPercent(float $red, float $green, float $blue, float $alpha=0, string $name='') : RGBAColor  | 
                                                        |
| 213 | + public static function createPercent(float $red, float $green, float $blue, float $alpha = 0, string $name = '') : RGBAColor  | 
                                                        |
| 214 | 214 |      { | 
                                                        
| 215 | 215 | return new RGBAColor(  | 
                                                        
| 216 | 216 | ColorChannel::percent($red),  | 
                                                        
@@ -232,7 +232,7 @@ discard block  | 
                                                    ||
| 232 | 232 | * @param string $name  | 
                                                        
| 233 | 233 | * @return RGBAColor  | 
                                                        
| 234 | 234 | */  | 
                                                        
| 235 | - public static function createCSS(int $red, int $green, int $blue, float $alpha=0, string $name='') : RGBAColor  | 
                                                        |
| 235 | + public static function createCSS(int $red, int $green, int $blue, float $alpha = 0, string $name = '') : RGBAColor  | 
                                                        |
| 236 | 236 |      { | 
                                                        
| 237 | 237 | return self::create(  | 
                                                        
| 238 | 238 | ColorChannel::eightBit($red),  | 
                                                        
@@ -254,7 +254,7 @@ discard block  | 
                                                    ||
| 254 | 254 | * @param string $name  | 
                                                        
| 255 | 255 | * @return RGBAColor  | 
                                                        
| 256 | 256 | */  | 
                                                        
| 257 | - public static function create8Bit(int $red, int $green, int $blue, int $alpha=0, string $name='') : RGBAColor  | 
                                                        |
| 257 | + public static function create8Bit(int $red, int $green, int $blue, int $alpha = 0, string $name = '') : RGBAColor  | 
                                                        |
| 258 | 258 |      { | 
                                                        
| 259 | 259 | return self::create(  | 
                                                        
| 260 | 260 | ColorChannel::eightBit($red),  | 
                                                        
@@ -277,7 +277,7 @@ discard block  | 
                                                    ||
| 277 | 277 | * @param string $name  | 
                                                        
| 278 | 278 | * @return RGBAColor  | 
                                                        
| 279 | 279 | */  | 
                                                        
| 280 | - public static function createGD(int $red, int $green, int $blue, int $alpha=0, string $name='') : RGBAColor  | 
                                                        |
| 280 | + public static function createGD(int $red, int $green, int $blue, int $alpha = 0, string $name = '') : RGBAColor  | 
                                                        |
| 281 | 281 |      { | 
                                                        
| 282 | 282 | return self::create(  | 
                                                        
| 283 | 283 | ColorChannel::eightBit($red),  | 
                                                        
@@ -299,7 +299,7 @@ discard block  | 
                                                    ||
| 299 | 299 | $color = imagecolorsforindex($img, $colorIndex);  | 
                                                        
| 300 | 300 | |
| 301 | 301 | // it seems imagecolorsforindex() may return false (undocumented, unproven)  | 
                                                        
| 302 | -        if(is_array($color)) { | 
                                                        |
| 302 | +        if (is_array($color)) { | 
                                                        |
| 303 | 303 | return self::create(  | 
                                                        
| 304 | 304 | ColorChannel::eightBit($color['red']),  | 
                                                        
| 305 | 305 | ColorChannel::eightBit($color['green']),  | 
                                                        
@@ -322,10 +322,10 @@ discard block  | 
                                                    ||
| 322 | 322 | * @param float|AlphaChannel|NULL $alpha 0 to 1 or NULL if none.  | 
                                                        
| 323 | 323 | * @return HSVColor  | 
                                                        
| 324 | 324 | */  | 
                                                        
| 325 | - public static function createHSV($hue, $saturation, $brightness, $alpha=null) : HSVColor  | 
                                                        |
| 325 | + public static function createHSV($hue, $saturation, $brightness, $alpha = null) : HSVColor  | 
                                                        |
| 326 | 326 |      { | 
                                                        
| 327 | 327 | $alphaChannel = null;  | 
                                                        
| 328 | -        if($alpha !== null) { | 
                                                        |
| 328 | +        if ($alpha !== null) { | 
                                                        |
| 329 | 329 | $alphaChannel = ColorChannel::alpha($alpha);  | 
                                                        
| 330 | 330 | }  | 
                                                        
| 331 | 331 | |
@@ -361,7 +361,7 @@ discard block  | 
                                                    ||
| 361 | 361 | $brightness = $hsv['brightness'] ?? $hsv[2] ?? null;  | 
                                                        
| 362 | 362 | $alpha = $hsv['alpha'] ?? $hsv[3] ?? null;  | 
                                                        
| 363 | 363 | |
| 364 | -        if($hue !== null && $saturation !== null && $brightness !== null) { | 
                                                        |
| 364 | +        if ($hue !== null && $saturation !== null && $brightness !== null) { | 
                                                        |
| 365 | 365 | return self::createHSV(  | 
                                                        
| 366 | 366 | $hue,  | 
                                                        
| 367 | 367 | $saturation,  | 
                                                        
@@ -42,11 +42,11 @@ discard block  | 
                                                    ||
| 42 | 42 | public static function color2HEX(RGBAColor $color) : string  | 
                                                        
| 43 | 43 |      { | 
                                                        
| 44 | 44 | $hex =  | 
                                                        
| 45 | - UnitsConverter::int2hex($color->getRed()->get8Bit()) .  | 
                                                        |
| 46 | - UnitsConverter::int2hex($color->getGreen()->get8Bit()) .  | 
                                                        |
| 45 | + UnitsConverter::int2hex($color->getRed()->get8Bit()).  | 
                                                        |
| 46 | + UnitsConverter::int2hex($color->getGreen()->get8Bit()).  | 
                                                        |
| 47 | 47 | UnitsConverter::int2hex($color->getBlue()->get8Bit());  | 
                                                        
| 48 | 48 | |
| 49 | - if($color->hasTransparency())  | 
                                                        |
| 49 | + if ($color->hasTransparency())  | 
                                                        |
| 50 | 50 |          { | 
                                                        
| 51 | 51 | $hex .= UnitsConverter::int2hex($color->getAlpha()->get8Bit());  | 
                                                        
| 52 | 52 | }  | 
                                                        
@@ -62,7 +62,7 @@ discard block  | 
                                                    ||
| 62 | 62 | */  | 
                                                        
| 63 | 63 | public static function color2CSS(RGBAColor $color) : string  | 
                                                        
| 64 | 64 |      { | 
                                                        
| 65 | - if($color->hasTransparency())  | 
                                                        |
| 65 | + if ($color->hasTransparency())  | 
                                                        |
| 66 | 66 |          { | 
                                                        
| 67 | 67 | return sprintf(  | 
                                                        
| 68 | 68 | 'rgba(%s, %s, %s, %s)',  | 
                                                        
@@ -97,7 +97,7 @@ discard block  | 
                                                    ||
| 97 | 97 | */  | 
                                                        
| 98 | 98 | public static function requireValidColorArray(array $color) : void  | 
                                                        
| 99 | 99 |      { | 
                                                        
| 100 | - if(self::isColorArray($color))  | 
                                                        |
| 100 | + if (self::isColorArray($color))  | 
                                                        |
| 101 | 101 |          { | 
                                                        
| 102 | 102 | return;  | 
                                                        
| 103 | 103 | }  | 
                                                        
@@ -129,9 +129,9 @@ discard block  | 
                                                    ||
| 129 | 129 | RGBAColor::CHANNEL_BLUE  | 
                                                        
| 130 | 130 | );  | 
                                                        
| 131 | 131 | |
| 132 | - foreach($keys as $key)  | 
                                                        |
| 132 | + foreach ($keys as $key)  | 
                                                        |
| 133 | 133 |          { | 
                                                        
| 134 | - if(!isset($color[$key]))  | 
                                                        |
| 134 | + if (!isset($color[$key]))  | 
                                                        |
| 135 | 135 |              { | 
                                                        
| 136 | 136 | return false;  | 
                                                        
| 137 | 137 | }  | 
                                                        
@@ -150,7 +150,7 @@ discard block  | 
                                                    ||
| 150 | 150 | */  | 
                                                        
| 151 | 151 | public static function color2readable(RGBAColor $color) : string  | 
                                                        
| 152 | 152 |      { | 
                                                        
| 153 | - if($color->hasTransparency())  | 
                                                        |
| 153 | + if ($color->hasTransparency())  | 
                                                        |
| 154 | 154 |          { | 
                                                        
| 155 | 155 | return sprintf(  | 
                                                        
| 156 | 156 | 'RGBA(%s %s %s %s)',  | 
                                                        
@@ -188,9 +188,9 @@ discard block  | 
                                                    ||
| 188 | 188 | * @throws ColorException  | 
                                                        
| 189 | 189 | * @see RGBAColor::ERROR_INVALID_HEX_LENGTH  | 
                                                        
| 190 | 190 | */  | 
                                                        
| 191 | - public static function hex2color(string $hex, string $name='') : RGBAColor  | 
                                                        |
| 191 | + public static function hex2color(string $hex, string $name = '') : RGBAColor  | 
                                                        |
| 192 | 192 |      { | 
                                                        
| 193 | - if(!isset(self::$hexParser))  | 
                                                        |
| 193 | + if (!isset(self::$hexParser))  | 
                                                        |
| 194 | 194 |          { | 
                                                        
| 195 | 195 | self::$hexParser = new HEXParser();  | 
                                                        
| 196 | 196 | }  | 
                                                        
@@ -242,7 +242,7 @@ discard block  | 
                                                    ||
| 242 | 242 |      { | 
                                                        
| 243 | 243 | // If one associative key is present, we assume  | 
                                                        
| 244 | 244 | // that the color array is already correct.  | 
                                                        
| 245 | - if(isset($color[RGBAColor::CHANNEL_RED]))  | 
                                                        |
| 245 | + if (isset($color[RGBAColor::CHANNEL_RED]))  | 
                                                        |
| 246 | 246 |          { | 
                                                        
| 247 | 247 | return $color;  | 
                                                        
| 248 | 248 | }  | 
                                                        
@@ -250,15 +250,15 @@ discard block  | 
                                                    ||
| 250 | 250 | $values = array_values($color);  | 
                                                        
| 251 | 251 | $result = array();  | 
                                                        
| 252 | 252 | |
| 253 | - foreach(self::$keys as $idx => $def)  | 
                                                        |
| 253 | + foreach (self::$keys as $idx => $def)  | 
                                                        |
| 254 | 254 |          { | 
                                                        
| 255 | - if(isset($values[$idx]))  | 
                                                        |
| 255 | + if (isset($values[$idx]))  | 
                                                        |
| 256 | 256 |              { | 
                                                        
| 257 | 257 | $result[$def['key']] = $values[$idx];  | 
                                                        
| 258 | 258 | continue;  | 
                                                        
| 259 | 259 | }  | 
                                                        
| 260 | 260 | |
| 261 | - if(!$def['mandatory'])  | 
                                                        |
| 261 | + if (!$def['mandatory'])  | 
                                                        |
| 262 | 262 |              { | 
                                                        
| 263 | 263 | continue;  | 
                                                        
| 264 | 264 | }  | 
                                                        
@@ -363,23 +363,23 @@ discard block  | 
                                                    ||
| 363 | 363 | public static function hsv2rgb(float $hue, float $saturation, float $brightness) : array  | 
                                                        
| 364 | 364 |      { | 
                                                        
| 365 | 365 | |
| 366 | -        if($hue < 0) {  $hue = 0.0; } // Hue: | 
                                                        |
| 367 | -        if($hue > 360) { $hue = 360.0; } // 0.0 to 360.0 | 
                                                        |
| 368 | -        if($saturation < 0) { $saturation = 0.0; } // Saturation: | 
                                                        |
| 369 | -        if($saturation > 100) { $saturation = 100.0; } // 0.0 to 100.0 | 
                                                        |
| 370 | -        if($brightness < 0) { $brightness = 0.0; }  // Brightness: | 
                                                        |
| 371 | -        if($brightness > 100) { $brightness = 100.0; } // 0.0 to 100.0 | 
                                                        |
| 372 | -  | 
                                                        |
| 373 | - $dS = $saturation/100.0; // Saturation: 0.0 to 1.0  | 
                                                        |
| 374 | - $dV = $brightness/100.0; // Brightness: 0.0 to 1.0  | 
                                                        |
| 375 | - $dC = $dV*$dS; // Chroma: 0.0 to 1.0  | 
                                                        |
| 376 | - $dH = $hue/60.0; // H-Prime: 0.0 to 6.0  | 
                                                        |
| 366 | +        if ($hue < 0) {  $hue = 0.0; } // Hue: | 
                                                        |
| 367 | +        if ($hue > 360) { $hue = 360.0; } // 0.0 to 360.0 | 
                                                        |
| 368 | +        if ($saturation < 0) { $saturation = 0.0; } // Saturation: | 
                                                        |
| 369 | +        if ($saturation > 100) { $saturation = 100.0; } // 0.0 to 100.0 | 
                                                        |
| 370 | +        if ($brightness < 0) { $brightness = 0.0; }  // Brightness: | 
                                                        |
| 371 | +        if ($brightness > 100) { $brightness = 100.0; } // 0.0 to 100.0 | 
                                                        |
| 372 | +  | 
                                                        |
| 373 | + $dS = $saturation / 100.0; // Saturation: 0.0 to 1.0  | 
                                                        |
| 374 | + $dV = $brightness / 100.0; // Brightness: 0.0 to 1.0  | 
                                                        |
| 375 | + $dC = $dV * $dS; // Chroma: 0.0 to 1.0  | 
                                                        |
| 376 | + $dH = $hue / 60.0; // H-Prime: 0.0 to 6.0  | 
                                                        |
| 377 | 377 | $dT = $dH; // Temp variable  | 
                                                        
| 378 | 378 | |
| 379 | -        while($dT >= 2.0) { $dT -= 2.0; } // php modulus does not work with float | 
                                                        |
| 380 | - $dX = $dC*(1-abs($dT-1)); // as used in the Wikipedia link  | 
                                                        |
| 379 | +        while ($dT >= 2.0) { $dT -= 2.0; } // php modulus does not work with float | 
                                                        |
| 380 | + $dX = $dC * (1 - abs($dT - 1)); // as used in the Wikipedia link  | 
                                                        |
| 381 | 381 | |
| 382 | -        switch(floor($dH)) { | 
                                                        |
| 382 | +        switch (floor($dH)) { | 
                                                        |
| 383 | 383 | case 0:  | 
                                                        
| 384 | 384 | $dR = $dC; $dG = $dX; $dB = 0.0; break;  | 
                                                        
| 385 | 385 | case 1:  | 
                                                        
@@ -330,12 +330,10 @@  | 
                                                    ||
| 330 | 330 | if ($R === $minRGB)  | 
                                                        
| 331 | 331 |          { | 
                                                        
| 332 | 332 | $h = 3 - (($G - $B) / $chroma);  | 
                                                        
| 333 | - }  | 
                                                        |
| 334 | - elseif ($B === $minRGB)  | 
                                                        |
| 333 | + } elseif ($B === $minRGB)  | 
                                                        |
| 335 | 334 |          { | 
                                                        
| 336 | 335 | $h = 1 - (($R - $G) / $chroma);  | 
                                                        
| 337 | - }  | 
                                                        |
| 338 | - else  | 
                                                        |
| 336 | + } else  | 
                                                        |
| 339 | 337 |          { // $G == $minRGB | 
                                                        
| 340 | 338 | $h = 5 - (($B - $R) / $chroma);  | 
                                                        
| 341 | 339 | }  | 
                                                        
@@ -135,7 +135,7 @@  | 
                                                    ||
| 135 | 135 | */  | 
                                                        
| 136 | 136 | public static function percent2Alpha(float $percent) : float  | 
                                                        
| 137 | 137 |      { | 
                                                        
| 138 | - return round($percent/100, self::$floatPrecision);  | 
                                                        |
| 138 | + return round($percent / 100, self::$floatPrecision);  | 
                                                        |
| 139 | 139 | }  | 
                                                        
| 140 | 140 | |
| 141 | 141 | /**  | 
                                                        
@@ -39,8 +39,8 @@ discard block  | 
                                                    ||
| 39 | 39 |      { | 
                                                        
| 40 | 40 | $value = (float)$value;  | 
                                                        
| 41 | 41 | |
| 42 | -        if($value < self::VALUE_MIN) { $value = self::VALUE_MIN; } | 
                                                        |
| 43 | -        if($value > self::VALUE_MAX) { $value = self::VALUE_MAX; } | 
                                                        |
| 42 | +        if ($value < self::VALUE_MIN) { $value = self::VALUE_MIN; } | 
                                                        |
| 43 | +        if ($value > self::VALUE_MAX) { $value = self::VALUE_MAX; } | 
                                                        |
| 44 | 44 | |
| 45 | 45 | $this->value = $value;  | 
                                                        
| 46 | 46 | }  | 
                                                        
@@ -72,6 +72,6 @@ discard block  | 
                                                    ||
| 72 | 72 | |
| 73 | 73 | public function invert() : PercentChannel  | 
                                                        
| 74 | 74 |      { | 
                                                        
| 75 | - return ColorChannel::percent(100-$this->value);  | 
                                                        |
| 75 | + return ColorChannel::percent(100 - $this->value);  | 
                                                        |
| 76 | 76 | }  | 
                                                        
| 77 | 77 | }  | 
                                                        
@@ -36,8 +36,8 @@ discard block  | 
                                                    ||
| 36 | 36 | */  | 
                                                        
| 37 | 37 | public function __construct(int $value)  | 
                                                        
| 38 | 38 |      { | 
                                                        
| 39 | -        if($value < self::VALUE_MIN) { $value = self::VALUE_MIN; } | 
                                                        |
| 40 | -        if($value > self::VALUE_MAX) { $value = self::VALUE_MAX; } | 
                                                        |
| 39 | +        if ($value < self::VALUE_MIN) { $value = self::VALUE_MIN; } | 
                                                        |
| 40 | +        if ($value > self::VALUE_MAX) { $value = self::VALUE_MAX; } | 
                                                        |
| 41 | 41 | |
| 42 | 42 | $this->value = $value;  | 
                                                        
| 43 | 43 | }  | 
                                                        
@@ -81,6 +81,6 @@ discard block  | 
                                                    ||
| 81 | 81 | |
| 82 | 82 | public function invert() : SevenBitChannel  | 
                                                        
| 83 | 83 |      { | 
                                                        
| 84 | - return ColorChannel::sevenBit(127-$this->value);  | 
                                                        |
| 84 | + return ColorChannel::sevenBit(127 - $this->value);  | 
                                                        |
| 85 | 85 | }  | 
                                                        
| 86 | 86 | }  | 
                                                        
@@ -34,8 +34,8 @@ discard block  | 
                                                    ||
| 34 | 34 | |
| 35 | 35 | public function __construct(int $value)  | 
                                                        
| 36 | 36 |      { | 
                                                        
| 37 | -        if($value < self::VALUE_MIN) { $value = self::VALUE_MIN; } | 
                                                        |
| 38 | -        if($value > self::VALUE_MAX) { $value = self::VALUE_MAX; } | 
                                                        |
| 37 | +        if ($value < self::VALUE_MIN) { $value = self::VALUE_MIN; } | 
                                                        |
| 38 | +        if ($value > self::VALUE_MAX) { $value = self::VALUE_MAX; } | 
                                                        |
| 39 | 39 | |
| 40 | 40 | $this->value = $value;  | 
                                                        
| 41 | 41 | }  | 
                                                        
@@ -70,6 +70,6 @@ discard block  | 
                                                    ||
| 70 | 70 | |
| 71 | 71 | public function invert() : EightBitChannel  | 
                                                        
| 72 | 72 |      { | 
                                                        
| 73 | - return ColorChannel::eightBit(255-$this->value);  | 
                                                        |
| 73 | + return ColorChannel::eightBit(255 - $this->value);  | 
                                                        |
| 74 | 74 | }  | 
                                                        
| 75 | 75 | }  | 
                                                        
@@ -40,8 +40,8 @@ discard block  | 
                                                    ||
| 40 | 40 |      { | 
                                                        
| 41 | 41 | $value = (float)$value;  | 
                                                        
| 42 | 42 | |
| 43 | -        if($value < self::VALUE_MIN) { $value = self::VALUE_MIN; } | 
                                                        |
| 44 | -        if($value > self::VALUE_MAX) { $value = self::VALUE_MAX; } | 
                                                        |
| 43 | +        if ($value < self::VALUE_MIN) { $value = self::VALUE_MIN; } | 
                                                        |
| 44 | +        if ($value > self::VALUE_MAX) { $value = self::VALUE_MAX; } | 
                                                        |
| 45 | 45 | |
| 46 | 46 | $this->value = $value;  | 
                                                        
| 47 | 47 | }  | 
                                                        
@@ -87,6 +87,6 @@ discard block  | 
                                                    ||
| 87 | 87 | |
| 88 | 88 | public function invert() : HueChannel  | 
                                                        
| 89 | 89 |      { | 
                                                        
| 90 | - return ColorChannel::hue(360-$this->value);  | 
                                                        |
| 90 | + return ColorChannel::hue(360 - $this->value);  | 
                                                        |
| 91 | 91 | }  | 
                                                        
| 92 | 92 | }  | 
                                                        
@@ -33,8 +33,8 @@  | 
                                                    ||
| 33 | 33 | |
| 34 | 34 | public function __construct(float $value)  | 
                                                        
| 35 | 35 |      { | 
                                                        
| 36 | -        if($value < self::VALUE_MIN) { $value = self::VALUE_MIN; } | 
                                                        |
| 37 | -        if($value > self::VALUE_MAX) { $value = self::VALUE_MAX; } | 
                                                        |
| 36 | +        if ($value < self::VALUE_MIN) { $value = self::VALUE_MIN; } | 
                                                        |
| 37 | +        if ($value > self::VALUE_MAX) { $value = self::VALUE_MAX; } | 
                                                        |
| 38 | 38 | |
| 39 | 39 | $this->value = $value;  | 
                                                        
| 40 | 40 | }  |