diff options
Diffstat (limited to 'includes/util/rainbow.inc')
-rw-r--r-- | includes/util/rainbow.inc | 11 |
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 |