diff options
author | Minteck <contact@minteck.org> | 2023-02-25 19:59:31 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2023-02-25 19:59:31 +0100 |
commit | 3d77712a9ab014635c75a33ea0f491bbda6aead3 (patch) | |
tree | 616bef5215db4f1d1cea2566079db2a130363e6b /includes/refresh.php | |
parent | 15bb1453008237edbc2cb4e82a9eb44db6f99794 (diff) | |
download | pluralconnect-3d77712a9ab014635c75a33ea0f491bbda6aead3.tar.gz pluralconnect-3d77712a9ab014635c75a33ea0f491bbda6aead3.tar.bz2 pluralconnect-3d77712a9ab014635c75a33ea0f491bbda6aead3.zip |
Updated 16 files and added 2 files (automated)
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; } } |