$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; }