def unpack(color):
    """
    Return the color as a quadruple (r, g, b, a), where a is 0 or 1
    (0 meaning transparent and 1 meaning opaque), and r, g and b are
    between 0 and 31 inclusive.
    """
    return color & 31, color >> 5 & 31, color >> 10 & 31, color >> 15 & 1
