import re


def is_hex_color(input_string):
    """The function to assess whether a string is hex color description.

    Taken from https://stackoverflow.com/questions/42876366/check-if-a-string-defines-a-color

    Parameters
    ----------
    input_string : str
      String which may contain hex color description

    Returns
    -------
    bool
      True if the string is a hex format definition, False otherwise.

    Examples
    --------
    >>> is_hex_color('notahex')
    False
    >>> is_hex_color('#FF0000')
    True
    """
    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
    return False