@@ -37,12 +37,12 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | if (strlen($htmlCode) === 3) { |
| 40 | - $htmlCode = $htmlCode[0] . $htmlCode[0] . $htmlCode[1] . $htmlCode[1] . $htmlCode[2] . $htmlCode[2]; |
|
| 40 | + $htmlCode = $htmlCode[0].$htmlCode[0].$htmlCode[1].$htmlCode[1].$htmlCode[2].$htmlCode[2]; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - $r = hexdec($htmlCode[0] . $htmlCode[1]); |
|
| 44 | - $g = hexdec($htmlCode[2] . $htmlCode[3]); |
|
| 45 | - $b = hexdec($htmlCode[4] . $htmlCode[5]); |
|
| 43 | + $r = hexdec($htmlCode[0].$htmlCode[1]); |
|
| 44 | + $g = hexdec($htmlCode[2].$htmlCode[3]); |
|
| 45 | + $b = hexdec($htmlCode[4].$htmlCode[5]); |
|
| 46 | 46 | |
| 47 | 47 | return ['r' => $r, 'g' => $g, 'b' => $b]; |
| 48 | 48 | } |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | public static function RGBToHSL(array $rgb): array |
| 58 | 58 | { |
| 59 | - $r = ((float)$rgb['r']) / 255.0; |
|
| 60 | - $g = ((float)$rgb['g']) / 255.0; |
|
| 61 | - $b = ((float)$rgb['b']) / 255.0; |
|
| 59 | + $r = ((float) $rgb['r']) / 255.0; |
|
| 60 | + $g = ((float) $rgb['g']) / 255.0; |
|
| 61 | + $b = ((float) $rgb['b']) / 255.0; |
|
| 62 | 62 | |
| 63 | 63 | $maxC = max($r, $g, $b); |
| 64 | 64 | $minC = min($r, $g, $b); |
@@ -86,9 +86,9 @@ discard block |
||
| 86 | 86 | $h /= 6.0; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - $h = (int)round(360.0 * $h); |
|
| 90 | - $s = (int)round(100.0 * $s); |
|
| 91 | - $l = (int)round(100.0 * $l); |
|
| 89 | + $h = (int) round(360.0 * $h); |
|
| 90 | + $s = (int) round(100.0 * $s); |
|
| 91 | + $l = (int) round(100.0 * $l); |
|
| 92 | 92 | |
| 93 | 93 | return ['h' => $h, 's' => $s, 'l' => $l]; |
| 94 | 94 | } |