Metadata-Version: 2.4
Name: dichromacy
Version: 0.1.0
Summary: Simulate the three dichromacies — protanopia, deuteranopia, tritanopia — for a color or image (Machado 2009).
Author: Vince Gonzalez
License: MIT
Project-URL: Homepage, https://opticquiz.com/
Project-URL: Source, https://github.com/vince-gonzalez/opticquiz.com
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cvdsim>=0.1.0
Provides-Extra: image
Requires-Dist: cvdsim[image]>=0.1.0; extra == "image"
Dynamic: license-file

# dichromacy

**Simulate the three dichromacies — protanopia, deuteranopia, tritanopia.** A color or a whole
image as a dichromat (missing one cone type) sees it.

```bash
pip install dichromacy
```

```js
import "dichromacy"
dichromacy.simulate("#d7191c", "deutan");   // that red to a deuteranope
dichromacy.protan("#1a9641");               // green to a protanope
const png = dichromacy.simulateImage("./chart.png", "tritan");
```

- **`simulate(color, type, severity?)`** → hex. `type` is `"protan"`, `"deutan"`, or `"tritan"`.
- **`simulateImage(input, type, opts?)`** → a recolored PNG Buffer.
- **`protan/deutan/tritan(color, severity?)`** → the named shortcuts.

An umbrella over [`cvdsim`](https://www.npmjs.com/package/cvdsim) (Machado, Oliveira & Fernandes 2009). For total color blindness see [`achromatopsia`](https://www.npmjs.com/package/achromatopsia); for mild vision see [`trichromacy`](https://www.npmjs.com/package/trichromacy). A simulation, not a diagnosis.

## Licence
MIT.
