def is_hex(color):

    """ Method to check if a color code is hexadecimal (HEX)

    This method returns the value True if the input argument corresponds to an hexadecimal color
    code.

    Parameters
    ----------
    color: :obj:
        Color code

    Returns
    -------
    bool
        True if the input color code takes the hexadecimal (HEX) form.

    Examples
    --------

    >>> from uibcdf_stdlib.colors import is_hex
    >>> is_hex('#008080')
    True
    >>> is_hex([0.0, 0.5, 0.5])
    False

    """

    output = False

    if type(color)==str:
        if (len(color)==6) or (len(color)==7 and color.startswith('#')):
            output = True

    return output