@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | * @param float $hue The hue (to be converted to an RGB value) For red, add 1/3 to the hue, green |
| 132 | 132 | * leave it alone, and blue you subtract 1/3 from the hue. |
| 133 | 133 | * |
| 134 | - * @return mixed |
|
| 134 | + * @return double |
|
| 135 | 135 | */ |
| 136 | 136 | private static function hueToRgb($p, $q, $hue) |
| 137 | 137 | { |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | } |
| 472 | 472 | |
| 473 | 473 | /** |
| 474 | - * @return array |
|
| 474 | + * @return integer[] |
|
| 475 | 475 | */ |
| 476 | 476 | public function jsonSerialize() |
| 477 | 477 | { |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * |
| 61 | 61 | * @return Color |
| 62 | 62 | */ |
| 63 | - public static function fromRgb( $red, $green, $blue) |
|
| 63 | + public static function fromRgb($red, $green, $blue) |
|
| 64 | 64 | { |
| 65 | 65 | if (!Validator::isValidRgb($red, $green, $blue)) { |
| 66 | 66 | throw new InvalidColorException('Invalid RGB values'); |
@@ -112,9 +112,9 @@ discard block |
||
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | return [ |
| 115 | - 'r' => (int)hexdec(substr($color, 0, 2)), |
|
| 116 | - 'g' => (int)hexdec(substr($color, 2, 2)), |
|
| 117 | - 'b' => (int)hexdec(substr($color, 4, 2)), |
|
| 115 | + 'r' => (int) hexdec(substr($color, 0, 2)), |
|
| 116 | + 'g' => (int) hexdec(substr($color, 2, 2)), |
|
| 117 | + 'b' => (int) hexdec(substr($color, 4, 2)), |
|
| 118 | 118 | ]; |
| 119 | 119 | } |
| 120 | 120 | |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | // If saturation is 0, the given color is grey and only |
| 175 | 175 | // lightness is relevant. |
| 176 | 176 | if ($saturation == 0) { |
| 177 | - $lightness = (int)ceil($lightness * 255); |
|
| 177 | + $lightness = (int) ceil($lightness * 255); |
|
| 178 | 178 | |
| 179 | 179 | return ['r' => $lightness, 'g' => $lightness, 'b' => $lightness]; |
| 180 | 180 | } |
@@ -194,9 +194,9 @@ discard block |
||
| 194 | 194 | $blue = self::hueToRgb($p, $q, $hue - 1 / 3); |
| 195 | 195 | |
| 196 | 196 | return [ |
| 197 | - 'r' => (int)round($red * 255, 2), |
|
| 198 | - 'g' => (int)round(round($green, 2) * 255), |
|
| 199 | - 'b' => (int)round($blue * 255, 2), |
|
| 197 | + 'r' => (int) round($red * 255, 2), |
|
| 198 | + 'g' => (int) round(round($green, 2) * 255), |
|
| 199 | + 'b' => (int) round($blue * 255, 2), |
|
| 200 | 200 | ]; |
| 201 | 201 | } |
| 202 | 202 | |
@@ -262,9 +262,9 @@ discard block |
||
| 262 | 262 | { |
| 263 | 263 | $color2 = $color->getRgb(); |
| 264 | 264 | |
| 265 | - return (int)abs($this->colors['r'] - $color2['r']) |
|
| 266 | - + (int)abs($this->colors['g'] - $color2['g']) |
|
| 267 | - + (int)abs($this->colors['b'] - $color2['b']); |
|
| 265 | + return (int) abs($this->colors['r'] - $color2['r']) |
|
| 266 | + + (int) abs($this->colors['g'] - $color2['g']) |
|
| 267 | + + (int) abs($this->colors['b'] - $color2['b']); |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | /** |