def clamp_value(value, max_value=1.0, min_value=0.0):
    return max(min(value, max_value), min_value)
Clamp a value between max and min
dataset/ETHPy150Open mikrosimage/ColorPipe-tools/utils/colors_helper.py/clamp_value