Skip to main content

trichromacy

Normal (three-cone) color vision — and anomalous trichromacy. A normal trichromat sees true color; anomalous trichromacy (protanomaly / deuteranomaly / tritanomaly) is a milder, shifted deficiency, modeled as a partial simulation.

pip install trichromacy
import "trichromacy"
trichromacy.simulate("#d7191c");                 // "#d7191c" — true color
trichromacy.anomalous("#d7191c", "deutan", 0.5); // mild deuteranomaly
const png = trichromacy.anomalousImage("./chart.png", "deutan", { severity: 0.5 });
  • simulate(color) → the color unchanged (normal trichromatic vision).
  • anomalous(color, type, severity=0.5) → a color under anomalous trichromacy; severity 0..1 (0 = normal, 1 = full dichromacy).
  • anomalousImage(input, type, opts?) → a recolored PNG Buffer; opts.severity default 0.5.

Built on cvdsim. For full dichromacies see dichromacy; for total color blindness see achromatopsia. A simulation, not a diagnosis.

Licence

MIT.

Metadata

Release files for trichromacy 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trichromacy 0.1.0
File Size Uploaded
trichromacy-0.1.0.tar.gz 3.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for trichromacy 0.1.0
File Interpreter ABI Platform
trichromacy-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.4 kB

Release files / trichromacy-0.1.0.tar.gz

Download URL trichromacy-0.1.0.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
37095f561c7377c4eb2e9989e15519d9a9c6a4bbeb6e59a15042d5eb5d0b3679
BLAKE2b-256 checksum
How to use checksums
a1ad02b329a832e1275a0784fc18341b8944de9ed88ca90fcb03419b28479182
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / trichromacy-0.1.0-py3-none-any.whl

Download URL trichromacy-0.1.0-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b46142d26941710c854bf19f68290bb38e8650bce8f7ea2caed71cd3233a397d
BLAKE2b-256 checksum
How to use checksums
f7f9e74fb4486dbbacf562dbb2a24a3d84d551ab70e8b5b65e8989e9883404af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page