colorblind
v0.2.0See a color or image as a colorblind person does; recolor images and make Ishihara plates.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
simulateColor Simulate a color under colorblindness
Return how a single hex color appears to someone with a given type of color-vision deficiency (protan, deutan, or tritan). Set severity 0..1 for a partial deficiency (anomalous trichromacy); 1 is the full dichromat case.
| Parameter | Type | Description |
|---|---|---|
color * | string | Hex color, e.g. #d7191c |
type * | string | Color-vision deficiency type |
severity | number | Deficiency strength 0..1 (default 1) |
compareVision Show a color under all three deficiencies
Return how a single hex color appears under protanopia, deuteranopia and tritanopia at once, for a side-by-side comparison.
| Parameter | Type | Description |
|---|---|---|
color * | string | Hex color, e.g. #1a9641 |
severity | number | Deficiency strength 0..1 (default 1) |
simulateImage Recolor an image as a colorblind person sees it
Recolor an image, chart, screenshot or mockup the way someone with color-vision deficiency sees it, and return the recolored image. Use this to SHOW what a design looks like through colorblindness (to check whether it stays readable, pair it with cvdsafe's checkImage). Reads PNG and JPEG — pass `path` for a local file, or a base64 `dataUri`. `type` picks the deficiency (default deutan); `severity` 0..1 sets strength.
| Parameter | Type | Description |
|---|---|---|
dataUri | string | Base64 data URI of the image, if you don't have a file path |
path | string | Path to a local PNG or JPEG file, e.g. ./chart.png |
severity | number | Deficiency strength 0..1 (default 1) |
type | string | Which deficiency to render (default deutan) |
plate Generate an Ishihara-style color-vision test plate
Generate a pseudoisochromatic (Ishihara-style) test plate: a digit hidden in a field of dots whose colors are distinct to normal vision but collapse under the chosen deficiency. Returns the plate image. Use when asked to create a colorblindness test plate or demonstrate what a plate looks like. Reproducible from a seed.
| Parameter | Type | Description |
|---|---|---|
number * | string | The digit(s) to hide, e.g. "7" or "29" |
seed | integer | Same seed -> identical plate (default 1) |
type | string | Which deficiency the figure should collapse under (default deutan) |