import re


def is_hex_color(input_string):
    """Check if a string has the format of a hex color (#fff or #ffffff)"""
    hex_color_regex = r"^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"
    regexp = re.compile(hex_color_regex)
    if regexp.search(input_string):
        return True
    else:
        return False