def _clamp(ch):
        if ch < 0:
            return 0.
        if ch > 1:
            return 1.
        return ch


# TODO: handle more colorspaces, and arbitrary extra channels.
dataset/ETHPy150Open eevee/sanpera/sanpera/color.py/_clamp/original