def cmap_from_color(color, dark=False):
if dark:<EOL><INDENT>return sns.dark_palette(color, as_cmap=True)<EOL><DEDENT>else:<EOL><INDENT>return sns.light_palette(color, as_cmap=True)<EOL><DEDENT>
Generates a matplotlib colormap from a single color.

Colormap will be built, by default, from white to ``color``.

Args:

    color: Can be one of several things:

        1. Hex code
        2. HTML color name
        3. RGB tuple

    dark (bool): If ``True``, colormap will be built from ``color`` to
        black. Default is ``False``, which builds a colormap from
        white to ``color``.

Returns:

    colormap: A matplotlib colormap