import re


def is_hex_color(color: str) -> bool:
    """
    Checks if a given color string is a valid hex color
    :param color:
    :return:
    """
    match = re.search(r"^#(?:[0-9a-fA-F]{3}){1,2}$", color)
    if not match:
        return False
    return True