A pretty color palette manager and matplotlib plotting utility for Python
Project description
A color palette manager and matplotlib plotting utility for Python.
Free software: GNU General Public License v3
Documentation: https://pychromatic.readthedocs.io.
Features
22 curated color palettes including 4 colorblind-friendly sets (Okabe–Ito, Tableau 10, Tol Bright, Tol Muted)
Color manipulation: brighten, darken, mix, find intermediates
Color format conversions: hex, RGB, HLS
Sample any matplotlib colormap with get_color(0.5, 'viridis')
Generate matplotlib colormaps from any palette with palette_cmap()
Opinionated matplotlib plot templates (Multiplot, BrokenAxes)
chromatify decorator for auto-styling matplotlib subplots
Rich terminal color preview via Color.display()
Installation
$ pip install pychromatic
For development:
$ pip install -e ".[dev]"
Quick Start
from pychromatic import Palette, Color
# Use a built-in palette
p = Palette('default')
p.show()
# Work with individual colors
c = Color('#1976d2', name='blue')
c.brighten(0.2)
c.display()
# Sample a matplotlib colormap
from pychromatic import get_color, palette_cmap
hex_color = get_color(0.5, 'viridis') # '#21918c'
# Build a cmap from any pychromatic palette
cmap = palette_cmap('rainbow')
Colorblind-Friendly Palettes
pychromatic ships four accessibility-first palettes that can be used as Palette objects or imported directly as plain dictionaries:
from pychromatic import okabe_ito, tableau10, tol_bright, tol_muted
# Use as a Palette object
p = Palette('okabe_ito')
p.show()
# Or grab individual hex values from the dict
print(okabe_ito['orange']) # '#E69F00'
print(tableau10['teal']) # '#76B7B2'
Available colorblind palettes:
okabe_ito — 8 colors from the Okabe & Ito (2008) universal palette
tableau10 — 10 colors from Tableau’s default categorical palette
tol_bright — 7 high-contrast colors from Paul Tol’s bright scheme
tol_muted — 9 low-chroma colors from Paul Tol’s muted scheme
Available Palettes
Name |
Colors |
Type |
|---|---|---|
default |
15 |
qualitative |
pastels |
12 |
qualitative |
basics |
9 |
qualitative |
set1_dark |
8 |
qualitative |
set1_pastel |
8 |
qualitative |
excel |
7 |
qualitative |
set2 – set7 |
5 |
qualitative |
5 |
qualitative |
|
dark |
5 |
qualitative |
earth |
5 |
qualitative |
rainbow |
5 |
sequential |
accent |
15 |
qualitative |
okabe_ito |
8 |
qualitative (colorblind-safe) |
tableau10 |
10 |
qualitative (colorblind-safe) |
tol_bright |
7 |
qualitative (colorblind-safe) |
tol_muted |
9 |
qualitative (colorblind-safe) |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pychromatic-0.6.0.tar.gz.
File metadata
- Download URL: pychromatic-0.6.0.tar.gz
- Upload date:
- Size: 833.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a2cfaa8485bdc0051eaa97a8d91050bd110bb438616f6ffd667c490c771d182
|
|
| MD5 |
ab781893b6c90bf749a956aa8b12ec4c
|
|
| BLAKE2b-256 |
497a3819b9271c1265544aebfb8776b7b29d612ec96bde31d927435eacd73449
|
Provenance
The following attestation bundles were made for pychromatic-0.6.0.tar.gz:
Publisher:
publish.yml on pyscal/pychromatic
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pychromatic-0.6.0.tar.gz -
Subject digest:
8a2cfaa8485bdc0051eaa97a8d91050bd110bb438616f6ffd667c490c771d182 - Sigstore transparency entry: 1004869913
- Sigstore integration time:
-
Permalink:
pyscal/pychromatic@6400dd411c9fe5be6453fafd9c4545c707821a80 -
Branch / Tag:
refs/tags/0.6.0 - Owner: https://github.com/pyscal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6400dd411c9fe5be6453fafd9c4545c707821a80 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pychromatic-0.6.0-py3-none-any.whl.
File metadata
- Download URL: pychromatic-0.6.0-py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccab61562b8a50c9da6e9257b8bb1b70254eb87f2d7c519444e45a9280c72176
|
|
| MD5 |
d4e674841cedf9c74867d7a490723bae
|
|
| BLAKE2b-256 |
978b70580d745356340d9dd0628cb2c08185863b5963a71cfbd82ead8e169446
|
Provenance
The following attestation bundles were made for pychromatic-0.6.0-py3-none-any.whl:
Publisher:
publish.yml on pyscal/pychromatic
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pychromatic-0.6.0-py3-none-any.whl -
Subject digest:
ccab61562b8a50c9da6e9257b8bb1b70254eb87f2d7c519444e45a9280c72176 - Sigstore transparency entry: 1004869914
- Sigstore integration time:
-
Permalink:
pyscal/pychromatic@6400dd411c9fe5be6453fafd9c4545c707821a80 -
Branch / Tag:
refs/tags/0.6.0 - Owner: https://github.com/pyscal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6400dd411c9fe5be6453fafd9c4545c707821a80 -
Trigger Event:
release
-
Statement type: