def is_hex(value):
        """Check for valid Hex triplet value.

        Parameters
        ----------
        value : string (e.g. "#FF0000")
            the value to be checked

        Returns
        -------
        valid : bool
            whether the value is valid or not

        """

        if not isinstance(value, str):
            return False

        value = value.lstrip("#")
        if len(value) != 6:
            return False
        else:
            for x in value.upper():
                if x not in "0123456789ABCDEF":
                    return False
        return True