diff options
author | RaindropsSys <contact@minteck.org> | 2023-03-12 19:16:53 +0100 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-03-12 19:16:53 +0100 |
commit | eb89b15c0f044673c1206a418a21d0baba1a675e (patch) | |
tree | 39ac31a576d8b8392cbd9baf8d67621bf2cefa86 /includes/rainbow.inc | |
parent | 5385f0ed8fbb4325203a222a75e6700ffb519349 (diff) | |
download | pluralconnect-eb89b15c0f044673c1206a418a21d0baba1a675e.tar.gz pluralconnect-eb89b15c0f044673c1206a418a21d0baba1a675e.tar.bz2 pluralconnect-eb89b15c0f044673c1206a418a21d0baba1a675e.zip |
Updated 104 files, added 3 files, deleted 4 files and renamed 36 files (automated)
Diffstat (limited to 'includes/rainbow.inc')
-rw-r--r-- | includes/rainbow.inc | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/includes/rainbow.inc b/includes/rainbow.inc deleted file mode 100644 index 01b234c..0000000 --- a/includes/rainbow.inc +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; - -function rainbow($hideCloudburst = false): array { - $members = scoreOrderGlobal(); - - if ($hideCloudburst) { - $members = array_filter($members, function ($i) { - return $i["_system"] === "gdapd"; - }); - } - - $data = []; - - foreach ($members as $member) { - $data[$member["name"]] = [ - "_data" => $member - ]; - - if (isset($member["color"])) { - $data[$member["name"]]["rgb"] = [ - hexdec(substr($member["color"], 0, 2)), - hexdec(substr($member["color"], 2, 2)), - hexdec(substr($member["color"], 4, 2)) - ]; - $data[$member["name"]]["hsl"] = rgbToHsl( - $data[$member["name"]]["rgb"][0], - $data[$member["name"]]["rgb"][1], - $data[$member["name"]]["rgb"][2] - ); - } else { - $data[$member["name"]]["rgb"] = [255, 255, 255]; - $data[$member["name"]]["hsl"] = rgbToHsl(255, 255, 255); - } - } - - return $data; -} - -function getMembersByColor($hideCloudburst = false): array { - $members = rainbow($hideCloudburst); - uasort($members, function ($a, $b) { - return $a['hsl'][0] - $b['hsl'][0]; - }); - - $sorted = []; - foreach ($members as $data) { - $data["_data"]["hue"] = $data["hsl"][0]; - $sorted[] = $data["_data"]; - } - - return $sorted; -}
\ No newline at end of file |