def mhp_palette_v1(num_cls=None):
    """
    Generates the Multi-Human Parsing (MHP) v1.0 data-set color palette.
    Data-Set URL:
    https://lv-mhp.github.io/
    Color palette definition:
    https://lv-mhp.github.io/human_parsing_task
    Original source taken from:
    https://gluon-cv.mxnet.io/_modules/gluoncv/utils/viz/segmentation.html .

    `num_cls`: the number of colors to generate
    return: the generated color palette
    """
    palette = [
        255, 255, 255,
        165, 42, 42,
        255, 0, 0,
        0, 128, 0,
        165, 42, 42,
        255, 69, 0,
        255, 20, 147,
        30, 144, 255,
        85, 107, 47,
        0, 128, 128,
        139, 69, 19,
        70, 130, 180,
        50, 205, 50,
        0, 0, 205,
        0, 191, 255,
        0, 255, 255,
        0, 250, 154,
        173, 255, 47,
        255, 255, 0,
    ]

    if num_cls is not None:
        if num_cls >= len(palette):
            raise Exception("Palette Color Definition exceeded.")
        palette = palette[:num_cls*3]
    return palette