def get_pallete(categories):
    """Generate pallete for categories.

    Args:
        categories (list or tuple): Names of all categories.

    Returns:
        dict: Pallete of all categories.
    """

    num_cls = len(categories) + 1
    color_map = num_cls * [0, 0, 0]
    for i in range(0, num_cls):
        j = 0
        lab = i
        while lab:
            color_map[i * 3] |= (((lab >> 0) & 1) << (7 - j))
            color_map[i * 3 + 1] |= (((lab >> 1) & 1) << (7 - j))
            color_map[i * 3 + 2] |= (((lab >> 2) & 1) << (7 - j))
            j += 1
            lab >>= 3
    pallete = dict()
    for idx, i in enumerate(range(3, len(color_map), 3)):
        pallete.update({categories[idx]: color_map[i:i + 3]})

    return pallete