summaryrefslogtreecommitdiff
path: root/includes/util/rainbow.inc
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-06-07 17:01:59 +0200
committerRaindropsSys <contact@minteck.org>2023-06-07 17:01:59 +0200
commite5f50fb2ee79d26fec2c14b5e4dff0b5e3b481fa (patch)
treea8869a34a662ba36c5e782f009adffadb8eeb6e1 /includes/util/rainbow.inc
parentca07d777b1a35b43d587e7302346b35a8c4dece2 (diff)
downloadpluralconnect-e5f50fb2ee79d26fec2c14b5e4dff0b5e3b481fa.tar.gz
pluralconnect-e5f50fb2ee79d26fec2c14b5e4dff0b5e3b481fa.tar.bz2
pluralconnect-e5f50fb2ee79d26fec2c14b5e4dff0b5e3b481fa.zip
Updated 11 files and added 3 files (automated)
Diffstat (limited to 'includes/util/rainbow.inc')
-rw-r--r--includes/util/rainbow.inc11
1 files changed, 9 insertions, 2 deletions
diff --git a/includes/util/rainbow.inc b/includes/util/rainbow.inc
index 66ac2fc..dc4d687 100644
--- a/includes/util/rainbow.inc
+++ b/includes/util/rainbow.inc
@@ -40,8 +40,9 @@ function rainbow($hideCloudburst = false): array {
return $data;
}
-function getMembersByColor($hideCloudburst = false): array {
+function getMembersByColor($hideCloudburst = false, $ignoreHumans = false): array {
$members = rainbow($hideCloudburst);
+
uasort($members, function ($a, $b) {
return $a['hsl'][0] - $b['hsl'][0];
});
@@ -52,5 +53,11 @@ function getMembersByColor($hideCloudburst = false): array {
$sorted[] = $data["_data"];
}
- return $sorted;
+ if ($ignoreHumans) {
+ return array_filter($sorted, function ($i) {
+ return !in_array("human", $i["_metadata"]["species"]);
+ });
+ } else {
+ return $sorted;
+ }
} \ No newline at end of file