@@ -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 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | */ |
98 | 98 | public static function hexadecimal($hex) : HexadecimalChannel |
99 | 99 | { |
100 | - if($hex instanceof HexadecimalChannel) { |
|
100 | + if ($hex instanceof HexadecimalChannel) { |
|
101 | 101 | return $hex; |
102 | 102 | } |
103 | 103 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | */ |
111 | 111 | public static function eightBit($value) : EightBitChannel |
112 | 112 | { |
113 | - if($value instanceof EightBitChannel) { |
|
113 | + if ($value instanceof EightBitChannel) { |
|
114 | 114 | return $value; |
115 | 115 | } |
116 | 116 | |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public static function sevenBit($value) : SevenBitChannel |
125 | 125 | { |
126 | - if($value instanceof SevenBitChannel) { |
|
126 | + if ($value instanceof SevenBitChannel) { |
|
127 | 127 | return $value; |
128 | 128 | } |
129 | 129 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | */ |
137 | 137 | public static function percent($percent) : PercentChannel |
138 | 138 | { |
139 | - if($percent instanceof PercentChannel) { |
|
139 | + if ($percent instanceof PercentChannel) { |
|
140 | 140 | return $percent; |
141 | 141 | } |
142 | 142 | |
@@ -149,11 +149,11 @@ discard block |
||
149 | 149 | */ |
150 | 150 | public static function alpha($alpha) : AlphaChannel |
151 | 151 | { |
152 | - if($alpha instanceof AlphaChannel) { |
|
152 | + if ($alpha instanceof AlphaChannel) { |
|
153 | 153 | return $alpha; |
154 | 154 | } |
155 | 155 | |
156 | - if($alpha === null) { |
|
156 | + if ($alpha === null) { |
|
157 | 157 | $alpha = 0.0; |
158 | 158 | } |
159 | 159 | |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | */ |
167 | 167 | public static function hue($hue) : HueChannel |
168 | 168 | { |
169 | - if($hue instanceof HueChannel) { |
|
169 | + if ($hue instanceof HueChannel) { |
|
170 | 170 | return $hue; |
171 | 171 | } |
172 | 172 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | */ |
180 | 180 | public static function brightness($brightness) : BrightnessChannel |
181 | 181 | { |
182 | - if($brightness instanceof BrightnessChannel) { |
|
182 | + if ($brightness instanceof BrightnessChannel) { |
|
183 | 183 | return $brightness; |
184 | 184 | } |
185 | 185 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | */ |
193 | 193 | public static function saturation($saturation) : SaturationChannel |
194 | 194 | { |
195 | - if($saturation instanceof SaturationChannel) { |
|
195 | + if ($saturation instanceof SaturationChannel) { |
|
196 | 196 | return $saturation; |
197 | 197 | } |
198 | 198 |
@@ -33,9 +33,9 @@ |
||
33 | 33 | private BrightnessChannel $brightness; |
34 | 34 | private ColorChannel $alpha; |
35 | 35 | |
36 | - public function __construct(HueChannel $hue, SaturationChannel $saturation, BrightnessChannel $brightness, ?ColorChannel $alpha=null) |
|
36 | + public function __construct(HueChannel $hue, SaturationChannel $saturation, BrightnessChannel $brightness, ?ColorChannel $alpha = null) |
|
37 | 37 | { |
38 | - if($alpha === null) { |
|
38 | + if ($alpha === null) { |
|
39 | 39 | $alpha = ColorChannel::alpha(0); |
40 | 40 | } |
41 | 41 |