@staticmethod
def cmap_from(matplotlib, hex_color_list: list):
    """Creates custom cmap from given hex_color list.

        Use :class:`~ColorMap` for more refined control. Color inputs should
        be HEX format.

        >>> import matplotlib
        >>> p =  Palette()
        >>> color_list = [p.aqua(), p.yellow(), p.gray()]
        >>> p.cmap_from(matplotlib, color_list) # <matplotlib.colors.LinearSegmentedColormap object at 0x000002623B6A1898>

        :param matplotlib: matplotlib object (https://matplotlib.org/)
        :param hex_color_list: List of colors in Hex format
        :return: *LinearSegmentedColormap* segment which can be used with
            *matplotlib* plots.
        """
    if type(hex_color_list) is not list:
        raise Exception('Please provide list of colors')
    try:
        return matplotlib.colors.LinearSegmentedColormap.from_list(
            'cMap_secret_colors', hex_color_list)
    except AttributeError:
        raise Exception(
            "Add 'matplotlib' as a first argument. For example, import matplotlib; palette.cmap_from(matplotlib, palette.red());"
            )
