def map_to_embed(map_name): global last_map hue = (zlib.adler32(map_name.encode()) & 0xff) / 0xff colour = Colour.from_hsv(hue, 0.5, 0.9) embed = Embed( title= f"F**k {last_map.split('_', 1)[-1].capitalize()} All My Homies Play", description=map_name, colour=colour) mode = { '3cp': 'CP', '5cp': 'CP', 'ad': 'AD', 'arena': 'Arena', 'cp': 'CP', 'ctf': 'CTF', 'dkoth': 'DKOTH', 'koth': 'KOTH', }[map_name.split('_')[0].lower()] img_url = f"https://raw.githubusercontent.com/Derpduck/GG2-Map-Archive/master/{mode}/{map_name}.png" embed = embed.set_image(url=img_url) last_map = map_name return embed
def random_colour() -> Colour: """ Returna un Colour aleatoreo """ return Colour.from_hsv(random.random(), 1, 1)
def random_colour() -> Colour: """Returns a random pastel colour""" return Colour.from_hsv(random(), uniform(0.75, 0.95), 1)