perceive-cvd
Colorblind (color vision deficiency) simulation using Brettel and Viénot models — in Rust.
Part of the Perceive accessibility platform. Live demo — drag an image in and see it through different types of color vision deficiency.
Features
- Brettel et al. (1997) — accurate two-half-plane simulation with configurable severity
- Viénot et al. (1999) — fast single-matrix simulation for real-time use
- All CVD types — protanopia, deuteranopia, tritanopia, achromatopsia
- Severity control — simulate partial color vision deficiency (0.0–1.0)
#![no_std]compatible- WASM ready — powers CVD preview in
@perceive/color
Quick Start
use Color;
use ;
let red = from_hex.unwrap;
// Accurate simulation with severity
let protan_50 = simulate;
// Full dichromacy (fast path)
let deutan_full = simulate_fast;
// Simulate all types for a color palette review
for cvd in
Models
| Model | Function | Accuracy | Speed | Severity |
|---|---|---|---|---|
| Brettel 1997 | simulate() |
High (two half-planes) | Normal | 0.0–1.0 |
| Viénot 1999 | simulate_fast() |
Good (single matrix) | Fast | Full only |
CVD Types
| Type | Affected Cones | Prevalence |
|---|---|---|
| Protan | L-cones (red) | ~1.3% of males |
| Deutan | M-cones (green) | ~5.0% of males |
| Tritan | S-cones (blue) | ~0.01% |
| Achromat | All | ~0.003% |
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.