diff options
Diffstat (limited to 'includes/refresh.php')
-rw-r--r-- | includes/refresh.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/includes/refresh.php b/includes/refresh.php index 3f3e7f4..65c570c 100644 --- a/includes/refresh.php +++ b/includes/refresh.php @@ -151,13 +151,15 @@ function getSystem(string $id, string $fileName = null, string $token = null) { $parsed = json_decode($data, true); foreach ($parsed as $index => $member) { - if (!isset($member["color"])) { - if (isset($member["avatar_url"])) { - $dominantColor = substr(ColorThief::getColor($member["avatar_url"], outputFormat: "hex"), 1); - } else { - $dominantColor = "ffffff"; - } + if (isset($member["avatar_url"])) { + $dominantColor = substr(ColorThief::getColor($member["avatar_url"], outputFormat: "hex"), 1); + } else { + $dominantColor = "ffffff"; + } + + $parsed[$index]["dominant_color"] = $dominantColor; + if (!isset($member["color"])) { $parsed[$index]["color"] = $dominantColor; } } |