def is_color(color):
    """
    Checks if supplied object is a valid color spec.
    """
    if not isinstance(color, basestring):
        return False
    elif RGB_HEX_REGEX.match(color):
        return True
    elif color in COLOR_ALIASES:
        return True
    elif color in cnames:
        return True
    return False
def is_color ( color ) : if not isinstance ( color , basestring ) : return False elif RGB_HEX_REGEX . match ( color ) : return True elif color in COLOR_ALIASES : return True elif color in cnames : return True return False
Checks if supplied object is a valid color spec.