def rgb_from_int(val):
    """Return an RGB tuple converted from an int in the range [0, 0xffffff]."""
    return tuple([
        ((val >> 16) & 0xff) / 0xff,
        ((val >> 8) & 0xff) / 0xff,
        (val & 0xff) / 0xff])