def validate_color(value):
    """Validates that the given value is a valid css color name.

    Args:
        value: a value

    Raises:
        ValueError: if ``value`` is not a valid css color name.
    """

    if not etau.is_str(value) or not (
        value in mcolors.CSS4_COLORS
        or re.search(r"^#(?:[0-9a-fA-F]{3}){1,2}$", value)
    ):
        raise ValueError(
            """%s is neither a valid CSS color name in all lowercase \n"""
            """(eg: 'yellowgreen') nor a hex color(eg. '#00ff00')""" % value
        )
Validates that the given value is a valid css color name.

    Args:
        value: a value

    Raises:
        ValueError: if ``value`` is not a valid css color name.
    
fiftyone/core/utils.py