def convert_to_color(object, name, value):
    if isinstance(value, SequenceTypes) and len(value) == 3:
        return (range_check(value[0]),
                range_check(value[1]),
                range_check(value[2]))
    if isinstance(value, int):
        return ((value / 0x10000)        / 255.0,
                ((value / 0x100) & 0xFF) / 255.0,
                (value & 0xFF)           / 255.0)
    raise TraitError
Converts a tuple or an integer to an RGB color value, or raises a
dataset/ETHPy150Open enthought/traitsui/traitsui/qt4/rgb_color_trait.py/convert_to_color