def range_check(value):
    value = float(value)
    if 0.0 <= value <= 1.0:
        return value
    raise TraitError
Checks that *value* can be converted to a value in the range 0.0 to 1.0.
dataset/ETHPy150Open enthought/traitsui/traitsui/qt4/rgb_color_trait.py/range_check