(string)
return False
Checks if the given string is a valid color.

    :param str string: The string to check.
    :rtype: bool

    >>> from rivalcfg.color_helpers import is_color
    >>> is_color("#FF0000") # hexadecimal colors are supported
    True
    >>> is_color("#F00")  # short format allowed
    True
    >>> is_color("FF0000")  # "#" is optionnal
    True
    >>> is_color("#ff0000")  # case insensitive
    True
    >>> is_color("#FF00")  # not a valid color
    False
    >>> is_color("red")  # named color are supported
    True
    >>> is_color("RED")  # named color are case insensitive
    True
    >>> is_color("hello")  # not a valid color name
    False
Checks if the given string is a valid color.
Checks if the given string is a valid color .
def is_color(string):
    """Checks if the given string is a valid color.

    :param str string: The string to check.
    :rtype: bool

    >>> from rivalcfg.color_helpers import is_color
    >>> is_color("#FF0000") # hexadecimal colors are supported
    True
    >>> is_color("#F00")  # short format allowed
    True
    >>> is_color("FF0000")  # "#" is optionnal
    True
    >>> is_color("#ff0000")  # case insensitive
    True
    >>> is_color("#FF00")  # not a valid color
    False
    >>> is_color("red")  # named color are supported
    True
    >>> is_color("RED")  # named color are case insensitive
    True
    >>> is_color("hello")  # not a valid color name
    False
    """
    if string.lower() in NAMED_COLORS:
        return True
    if re.match(r"^#?[0-9a-f]{3}([0-9a-f]{3})?$", string, re.IGNORECASE):
        return True
    return False
def is_color ( string ) : if string . lower ( ) in NAMED_COLORS : return True if re . match ( r"^#?[0-9a-f]{3}([0-9a-f]{3})?$" , string , re . IGNORECASE ) : return True return False