SecretColors

SecretColors

Beautiful, ready-to-use color palettes and colormaps for Python. IBM, Material, Adobe Spectrum, ColorBrewer, Tableau and colorblind-safe schemes - one simple API.

Install

pip install SecretColors
pip install "SecretColors[all]"   # with matplotlib and Pillow
uv add SecretColors
uv add "SecretColors[all]"        # with matplotlib and Pillow
pip install "SecretColors[all] @ git+https://github.com/secretBiology/SecretColors"

Thirty seconds tour

from SecretColors import Palette

p = Palette()                   # IBM palette (default)
p.red()                         # '#fa4d56'
p.red(shade=20)                 # '#ffd7d9'  lighter
p.blue(no_of_colors=5)          # ['#edf5ff', '#9bc0ff', '#2a75fe', '#0032a9', '#001141']

from SecretColors import cmaps
cmaps.register()
plt.imshow(data, cmap="sc.Spectral")

Explore

8 Palettes

IBM, Material, Spectrum, Clarity, Latitude, ColorBrewer and Tableau, each with a full range of shades.

Palettes
83 Colormaps

Register once and use cmap="sc.greens" in matplotlib, pandas or seaborn.

Colormaps
Plotting

Make SecretColors the default look of your plots, in one line.

Plotting
Colors for everyone

Pick colors that stay distinct for colorblind readers and pass WCAG contrast checks.

Colors for everyone
Smooth gradients

Mix colors in perceptual L*a*b* or LCh space for vivid, even gradients.

Smooth gradients
Colorblind friendly

Okabe-Ito and Paul Tol schemes, plus colorblindness simulation.

Colorblind friendly
Palette from an image

Pull the dominant colors out of any photo.

Palette from an image
Color science

CIE L*a*b*, LCh, Delta E (CIEDE2000) and 16 RGB colorspaces.

Color science