async def map_rank_to_color(rank):
    """
    Maps rank to corresponding color.
    """

    color = 0xFF0000

    if not rank:
        color = 0x000000
    elif rank == "newbie":
        color = 0x918F8E
    elif rank == "pupil":
        color = 0x087515
    elif rank == "specialist":
        color = 0x1AF2F2
    elif rank == "expert":
        color = 0x1300F9
    elif rank == "candidate master":
        color = 0xB936EE
    elif rank == "master" or rank == "international master":
        color = 0xEEBB36

    return color