def clip_hsv(rgb, max_h=None, max_s=None, max_v=None):
    """
    reduces the hue, saturation and value of an rgb color
    """
    hsv, a = _rgb_to_hsv(rgb)
    if max_h is not None:
        assert 0 <= max_h <= 1
        hsv[0] = hsv[0] * max_h
    if max_s is not None:
        assert 0 <= max_s <= 1
        hsv[1] = hsv[1] * max_s
    if max_v is not None:
        assert 0 <= max_v <= 1
        hsv[2] = hsv[2] * max_v
    rgb = _hsv_to_rgb(hsv, a)

    return rgb

    reduces the hue, saturation and value of an rgb color
    
infinigen/core/util/random.py