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.
83 Colormaps
Register once and use cmap="sc.greens" in matplotlib, pandas or seaborn.
Plotting
Make SecretColors the default look of your plots, in one line.
Colors for everyone
Pick colors that stay distinct for colorblind readers and pass WCAG contrast checks.
Smooth gradients
Mix colors in perceptual L*a*b* or LCh space for vivid, even gradients.
Colorblind friendly
Okabe-Ito and Paul Tol schemes, plus colorblindness simulation.
Palette from an image
Pull the dominant colors out of any photo.
Color science
CIE L*a*b*, LCh, Delta E (CIEDE2000) and 16 RGB colorspaces.