Skip to content

ahuang11/tastymap

Repository files navigation

TastyMap

🎨 Color palettes for your palate πŸ˜‹

Make, customize, and/or use colormaps, any way you like.

tastykitchen

πŸ“– Quick start

Try to craft your visual delight interactively with the TastyKitchen UI, hosted here.

tastymap ui
image

Or, start cooking from pre-made colormaps...

from tastymap import cook_tmap

tmap = cook_tmap("viridis", num_colors=12, reverse=True)
tmap

viridis_12

Or start from scratch!

from tastymap import cook_tmap

tmap = cook_tmap(
    ["red", "green", "blue"],
    num_colors=256,
    reverse=True,
    name="rgb",
)
tmap

rgb_256

Then pair it with your plots effortlessly:

import numpy as np
from matplotlib import pyplot as plt
from tastymap import cook_tmap, pair_tbar

fig, ax = plt.subplots()
img = ax.imshow(np.random.random((10, 10)))
tmap = cook_tmap(["red", "green", "blue"], num_colors=256)
pair_tbar(
    img,
    tmap,
    bounds=[0, 0.01, 0.5, 1],
    labels=["zero", "tiny", "half", "one"],
    uniform_spacing=True,
)

example

Or if you need suggestions, get help from AI by providing a description of what you're imagining:

from tastymap import ai

tmap = ai.suggest_tmap("Pikachu")
tmap

image

Check out the docs for more recipes!

πŸ“¦ Installation

To get started on your culinary color journey, install tastymap with:

pip install tastymap

To get access to TastyKitchen UI, install tastymap with:

pip install tastymap[ui]

build codecov PyPI version

Documentation: https://ahuang11.github.io/tastymap/

Source Code: https://github.com/ahuang11/tastymap