npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

klar-plugin-cvd-machado

v1.0.1

Published

klar plugin: color-vision-deficiency confusability metric for extreme anomalous trichromacy (Machado 2009, severity 0.8) — deuteranomaly, protanomaly.

Readme

klar-plugin-cvd-machado

A klar plugin that measures whether two colors stay distinguishable for a person with anomalous trichromacy (partial color blindness — the most common form), using the Machado, Oliveira & Fernandes (2009) model at extreme severity.

It adds two contrast types:

| --type | Deficiency | |---|---| | cvd-deuteranomaly | shifted M (green) cone — extreme | | cvd-protanomaly | shifted L (red) cone — extreme |

What it measures

Each type simulates both input colors as that anomalous trichromat would see them, then returns the CIEDE2000 (ΔE₀₀) between the simulated colors:

  • high → the two colors stay clearly separated (good)
  • low → they collapse together / become confusable (a real accessibility problem)

Higher-is-better, integer-rounded — same polarity and rounding as klar's built-in deltaE.

Install

npm install -g klar-cli klar-plugin-cvd-machado

klar discovers it automatically via the klar-plugin-* convention.

Usage

$ klar contrast "#d40000" "#00a000" --type cvd-deuteranomaly -q
11
$ klar plugins list   # confirm the two types are registered

A common convention is to treat ΔE ≥ 11 as "still clearly distinct" — your policy to apply; the plugin returns the raw number.

About the "extreme" severity (and its caveat)

Machado's model is parameterized by a severity from 0 (normal) to 1 (dichromat). This plugin fixes severity at 0.8 — "extreme" anomalous (near-dichromatic) — because that's where the accessibility risk concentrates: mild anomalous trichromacy is close to normal vision, and full dichromacy is covered by the companion klar-plugin-cvd-brettel.

Caveat: Machado's severity is a spectral-shift parameter and only a rough proxy for how a given individual actually performs (optical-density variation means the mapping isn't monotonic). So 0.8 is labelled by what it physically is — "extreme anomalous" — not as "the average anomalous trichromat." The distribution of real-world severity is gene-driven and lumpy, not a bell curve.

Tritanomaly is intentionally excluded — it's S-cone based (different genetics, rare) and Machado models it poorly; tritan deficiency is served by the Brettel plugin.

Attribution & license

  • Plugin code: MIT.
  • Matrices from Machado, G. M., Oliveira, M. M., & Fernandes, L. A. F. (2009). A Physiologically-based Model for Simulation of Color Vision Deficiency. IEEE TVCG, 15(6). Matrix table, used with attribution. Applied in linear RGB (per DaltonLens).