dichromacy
v0.1.0
Published
Simulate the three dichromacies — protanopia, deuteranopia, tritanopia — for a color or a whole image. Umbrella over cvdsim / the OpticQuiz engine (Machado 2009).
Maintainers
Readme
dichromacy
Simulate the three dichromacies — protanopia, deuteranopia, tritanopia. A color or a whole image as a dichromat (missing one cone type) sees it.
npm install dichromacyconst dichromacy = require("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.typeis"protan","deutan", or"tritan".simulateImage(input, type, opts?)→ a recolored PNG Buffer.protan/deutan/tritan(color, severity?)→ the named shortcuts.
An umbrella over cvdsim (Machado, Oliveira & Fernandes 2009). For total color blindness see achromatopsia; for mild vision see trichromacy. A simulation, not a diagnosis.
Licence
MIT.
