safepalette
Colorblind-safe color palettes — generate, check, and fix. Ask for N safe colors, test a palette you have, or repair one that fails — protanopia, deuteranopia, tritanopia.
pip install safepalette
import safepalette as sp
sp.generate(5) # 5 colorblind-safe hex colors (Okabe-Ito based)
sp.is_safe(["#d7191c", "#1a9641"]) # False — red & green collapse under deutan/protan
sp.fix(["#d7191c", "#1a9641"])["colors"] # a safe palette near the originals
sp.OKABE_ITO # the canonical 8-color safe palette
API
generate(n, **opts)→ up toncolorblind-safe hex colors.n <= 8is the Okabe–Ito palette (safe by design); above 8 it extends only with colors that keep the whole set passing. Largenmay return fewer thann— never an unsafe color.is_safe(colors, **opts)→True/False.fix(colors, **opts)→{"colors", "drift", "pass", "residual"}, a safe palette near the originals.check(colors, **opts)→ the full per-type conflict report.
How it decides
check and fix are opticquiz-cvd's check_palette
and fix_palette — Machado, Oliveira & Fernandes (2009) + CIEDE2000, open access:
https://doi.org/10.5281/zenodo.21310578 . The generator is seeded with the Okabe–Ito safe palette
(Wong, Nature Methods, 2011). No colorimetry is reimplemented here.
Not a legal audit
A screening/design aid for the color-distinguishability axis, not a WCAG/ADA audit.
Licence
MIT.
Metadata
Release files for safepalette 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| safepalette-0.1.0.tar.gz | 3.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| safepalette-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.1 kB
Release files / safepalette-0.1.0.tar.gz
| Download URL | safepalette-0.1.0.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8cb2be9b16bff6778410e365877708116b22761221deeb4fcff8f3b3357c8870
|
|
BLAKE2b-256 checksum How to use checksums |
a1812f0c0319a70d935989eb9e1a769e0441c5e83756483b5294fe0288693e37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / safepalette-0.1.0-py3-none-any.whl
| Download URL | safepalette-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4a1327d5c12d283ff21bc4ae0da090a46c3f85db501bb033f87a29b50e10da1d
|
|
BLAKE2b-256 checksum How to use checksums |
d9234628fd9c2fbcae5fe52d7fd0216d76d099603ac5a6b684040dffc717a779
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for safepalette 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.