def validate_color_name(valid_names, color_name):
    """Return True if string is a valid color name."""
    ### remove spaces and make string all lowercase
    color_name = color_name.replace(" ", "").lower()

    ### if name of color is a key in our collection of
    ### valid names then we have a valid color name,
    ### so we return True
    if color_name in valid_names:
        return True

    ### even though 'unamed' doesn't represent an existing
    ### color, we consider it a valid name, so we return True
    ### as well
    elif color_name == "unamed":
        return True

    ### otherwise the name is not valid, so False is returned
    else:
        return False
Return True if string is a valid color name.
nodezator/ourstdlibs/color/utils.py