def instance_color(rgb=False, idx=1, maximum=255):
    """
    Args:
        rgb (bool): whether to return RGB colors or BGR colors.
        maximum (int): either 255 or 1
    Returns:
        ndarray: a vector of 3 numbers
    """
    ret = _COLORS[idx] * maximum
    if not rgb:
        ret = ret[::-1]
    return ret

    Args:
        rgb (bool): whether to return RGB colors or BGR colors.
        maximum (int): either 255 or 1
    Returns:
        ndarray: a vector of 3 numbers
    
ControlNet-v1-1-nightly/annotator/oneformer/oneformer/demo/visualizer.py