← Color Blindness Simulator
Your token

Color Blindness Simulator API

The simulated views, the color measurements, the list of colliding pairs, the tested fixes and every download run free in the browser and need no API. The API is for the one metered step: send the colors and pairs the page measured and an optional note, and get back, as JSON, a color critique covering contrast, palette coherence, meaning carried by color and color blindness. The picture itself is never sent. The page builds this input for you and checks the reply against its own numbers.

Base URL: https://api.skillsafe.ai/v1/app-api. Every response is {"data": ...} or {"error": {"code", "message"}}; read error.code and error.message rather than the HTTP status alone.

The task field

This app has one task. Always send "task": "critique".

taskWhat it doesReply
critiqueReads a screen's measured colors and color pairs and returns a verdict, a summary, four rated dimensions (contrast, palette_coherence, semantic_use, accessibility) with observation, problem and fix, notes on the pairs that matter, and checks to make on the real screen. It does not invent ratios or colors.One JSON object

Input fields

Every field is a string; colors, pairs and counts hold JSON text.

FieldMeaning
task"critique"
severity_pctSimulated strength, 10 to 100 (100 = full dichromacy).
page_verdictpass, minor_issue or major_issue, from the measurements.
colorsList of {id, hex, share_pct, lightness, chroma, neutral}, largest first, at most 12.
pairsList of {id, a, b, touching, contrast, low_contrast, de, status, page_fix}, at most 24, most serious first. de holds CIEDE2000 differences: normal, protan, deutan, tritan, achroma. status per type is same, close or ok.
counts{red_blind, green_blind, blue_blind, grayscale: {same, close}, low_contrast_touching}.
noteOptional: what the screen is and what its colors mean (at most 1,000 characters).
clipped_noteEmpty, or sentences saying which part of the input was cut.

The reply

job.output.output is text holding one JSON object: verdict, summary (2 to 4 sentences), dimensions (exactly four: contrast, palette_coherence, semantic_use, accessibility, each {id, rating, observation, problem, fix}), pairs (at most 8 {id, note, fix}) and checks (1 to 4 strings). Before showing it, check that pair ids are ones you sent and that ratios and hexes appear in your input, as the page does. If the balance ran low, truncated is true and the object may stop early; the page keeps every part that arrived whole.

Worked example

Input (input.json), from the page's "Line chart" example:

{
  "task": "critique",
  "severity_pct": "100",
  "page_verdict": "major_issue",
  "colors": "[{\"id\":\"C1\",\"hex\":\"#ffffff\",\"share_pct\":94.5,\"lightness\":100,\"chroma\":0,\"neutral\":true},{\"id\":\"C2\",\"hex\":\"#ff7f0e\",\"share_pct\":1.2,\"lightness\":67,\"chroma\":84,\"neutral\":false},{\"id\":\"C3\",\"hex\":\"#d62728\",\"share_pct\":1.2,\"lightness\":47,\"chroma\":79,\"neutral\":false},{\"id\":\"C4\",\"hex\":\"#2ca02c\",\"share_pct\":1.1,\"lightness\":58,\"chroma\":73,\"neutral\":false},{\"id\":\"C5\",\"hex\":\"#282828\",\"share_pct\":0.9,\"lightness\":16,\"chroma\":0,\"neutral\":true},{\"id\":\"C6\",\"hex\":\"#555555\",\"share_pct\":0.6,\"lightness\":36,\"chroma\":0,\"neutral\":true},{\"id\":\"C7\",\"hex\":\"#666666\",\"share_pct\":0.6,\"lightness\":43,\"chroma\":0,\"neutral\":true}]",
  "pairs": "[{\"id\":\"P1\",\"a\":\"C2\",\"b\":\"C4\",\"touching\":false,\"contrast\":1.34,\"low_contrast\":false,\"de\":{\"normal\":55.2,\"protan\":1.4,\"deutan\":14.5,\"tritan\":63.3,\"achroma\":7.8},\"status\":{\"protan\":\"same\",\"deutan\":\"ok\",\"tritan\":\"ok\",\"achroma\":\"close\"},\"page_fix\":{\"change\":\"C4\",\"from\":\"#2ca02c\",\"to\":\"#79ad6f\",\"min_de_after\":12.1,\"contrast_after\":1.03}},{\"id\":\"P2\",\"a\":\"C3\",\"b\":\"C4\",\"touching\":false,\"contrast\":1.47,\"low_contrast\":false,\"de\":{\"normal\":71.8,\"protan\":24.9,\"deutan\":4.8,\"tritan\":65.3,\"achroma\":10.8},\"status\":{\"protan\":\"ok\",\"deutan\":\"same\",\"tritan\":\"ok\",\"achroma\":\"ok\"},\"page_fix\":{\"change\":\"C4\",\"from\":\"#2ca02c\",\"to\":\"#6ea365\",\"min_de_after\":12.9,\"contrast_after\":1.69}},{\"id\":\"P3\",\"a\":\"C3\",\"b\":\"C6\",\"touching\":false,\"contrast\":1.48,\"low_contrast\":false,\"de\":{\"normal\":30.1,\"protan\":18,\"deutan\":27.6,\"tritan\":32.1,\"achroma\":9.6},\"status\":{\"protan\":\"ok\",\"deutan\":\"ok\",\"tritan\":\"ok\",\"achroma\":\"close\"}},{\"id\":\"P4\",\"a\":\"C3\",\"b\":\"C7\",\"touching\":false,\"contrast\":1.14,\"low_contrast\":false,\"de\":{\"normal\":28.7,\"protan\":18.8,\"deutan\":24.9,\"tritan\":30.3,\"achroma\":3.5},\"status\":{\"protan\":\"ok\",\"deutan\":\"ok\",\"tritan\":\"ok\",\"achroma\":\"same\"}},{\"id\":\"P5\",\"a\":\"C1\",\"b\":\"C2\",\"touching\":true,\"contrast\":2.53,\"low_contrast\":true,\"de\":{\"normal\":36.5,\"protan\":38.1,\"deutan\":33.6,\"tritan\":37.1,\"achroma\":22},\"status\":{\"protan\":\"ok\",\"deutan\":\"ok\",\"tritan\":\"ok\",\"achroma\":\"ok\"}},{\"id\":\"P6\",\"a\":\"C1\",\"b\":\"C3\",\"touching\":true,\"contrast\":5.02,\"low_contrast\":false,\"de\":{\"normal\":48.7,\"protan\":52.9,\"deutan\":42,\"tritan\":47.4,\"achroma\":39.5},\"status\":{\"protan\":\"ok\",\"deutan\":\"ok\",\"tritan\":\"ok\",\"achroma\":\"ok\"}},{\"id\":\"P7\",\"a\":\"C1\",\"b\":\"C4\",\"touching\":true,\"contrast\":3.4,\"low_contrast\":false,\"de\":{\"normal\":40.4,\"protan\":37.6,\"deutan\":37.9,\"tritan\":38.2,\"achroma\":29.5},\"status\":{\"protan\":\"ok\",\"deutan\":\"ok\",\"tritan\":\"ok\",\"achroma\":\"ok\"}},{\"id\":\"P8\",\"a\":\"C1\",\"b\":\"C5\",\"touching\":true,\"contrast\":14.74,\"low_contrast\":false,\"de\":{\"normal\":75.9,\"protan\":75.9,\"deutan\":75.9,\"tritan\":75.9,\"achroma\":75.9},\"status\":{\"protan\":\"ok\",\"deutan\":\"ok\",\"tritan\":\"ok\",\"achroma\":\"ok\"}},{\"id\":\"P9\",\"a\":\"C1\",\"b\":\"C7\",\"touching\":true,\"contrast\":5.74,\"low_contrast\":false,\"de\":{\"normal\":43.1,\"protan\":43.1,\"deutan\":43.1,\"tritan\":43.1,\"achroma\":43.1},\"status\":{\"protan\":\"ok\",\"deutan\":\"ok\",\"tritan\":\"ok\",\"achroma\":\"ok\"}},{\"id\":\"P10\",\"a\":\"C1\",\"b\":\"C6\",\"touching\":true,\"contrast\":7.45,\"low_contrast\":false,\"de\":{\"normal\":50.6,\"protan\":50.6,\"deutan\":50.6,\"tritan\":50.6,\"achroma\":50.6},\"status\":{\"protan\":\"ok\",\"deutan\":\"ok\",\"tritan\":\"ok\",\"achroma\":\"ok\"}}]",
  "counts": "{\"red_blind\":{\"same\":1,\"close\":0},\"green_blind\":{\"same\":1,\"close\":0},\"blue_blind\":{\"same\":0,\"close\":0},\"grayscale\":{\"same\":1,\"close\":2},\"low_contrast_touching\":1}",
  "note": "Quarterly line chart in a sales deck. Red is sales, green is costs, orange is profit; the legend is the only label.",
  "clipped_note": ""
}

Reply:

{"verdict":"major_issue","summary":"Per the note, the three series are told apart by hue alone, and two of the three collapse for color-blind viewers: orange profit (C2) and green costs (C4) look the same to red-blind viewers, and red sales (C3) and green costs look the same to green-blind viewers. The orange line is also faint on the white background at 2.53:1. The most important fix is to label each line directly at its end instead of relying on the legend, then adjust the green.","dimensions":[{"id":"contrast","rating":"minor_issue","observation":"Against white C1 #ffffff: dark gray C5 #282828 is 14.74:1, C6 #555555 is 7.45:1, C7 #666666 is 5.74:1, red C3 #d62728 is 5.02:1, green C4 #2ca02c is 3.4:1 and orange C2 #ff7f0e is 2.53:1. One touching pair is under 3:1.","problem":"P5 (orange C2 on white C1) at 2.53:1 is below the 3:1 a chart line needs, so the profit line is the weakest mark on the slide, especially on a projector. If C4 green is used for text it also falls short of 4.5:1 at 3.4:1.","fix":"Make the orange profit line darker (keep the hue, lower its lightness) until it clears 3:1 on white, and thicken all three lines."},{"id":"palette_coherence","rating":"pass","observation":"Three saturated non-neutral colors (orange C2 lightness 67, red C3 lightness 47, green C4 lightness 58, chroma 73 to 84) plus white and three grays. Normal-vision differences between series are large: 55.2 for C2/C4 and 71.8 for C3/C4.","problem":"","fix":""},{"id":"semantic_use","rating":"major_issue","observation":"The note says red is sales, green is costs, orange is profit, and the legend is the only label, so series identity is carried by hue alone.","problem":"Readers must match each line to a legend swatch by color. When P1 or P2 collapse, a red- or green-blind viewer cannot tell which line is costs, which is the main message of a sales vs costs chart.","fix":"Put the series name (Sales, Costs, Profit) directly at the end of each line and give the lines different dash patterns or markers, so the legend is no longer needed to read them."},{"id":"accessibility","rating":"major_issue","observation":"P1 (orange C2 vs green C4) is same for red-blind viewers, difference 1.4. P2 (red C3 vs green C4) is same for green-blind viewers, difference 4.8. In grayscale P4 (C3 vs C7) is same at 3.5 and P1 and P3 are close.","problem":"Two of the three series pairs merge for the most common forms of color blindness, so many color-blind viewers in the audience cannot read the chart from the legend.","fix":"Use the page's tested replacement for green C4: #6ea365 lifts the red-green pair P2 to a smallest difference of 12.9; #79ad6f lifts P1 to 12.1. Pick one, re-check the other pair, and add direct labels either way."}],"pairs":[{"id":"P1","note":"Orange C2 #ff7f0e (profit) and green C4 #2ca02c (costs) differ by 55.2 normally but only 1.4 for red-blind viewers, so they look the same; contrast between them is 1.34:1.","fix":"Change C4 to the tested #79ad6f (smallest difference after 12.1), and label both lines directly."},{"id":"P2","note":"Red C3 #d62728 (sales) and green C4 #2ca02c (costs) differ by 71.8 normally but only 4.8 for green-blind viewers, so they look the same.","fix":"Change C4 to the tested #6ea365 (smallest difference after 12.9, contrast 1.69:1 between the pair), and use a dashed line for costs."},{"id":"P5","note":"Orange C2 #ff7f0e on white C1 #ffffff is 2.53:1, under the 3:1 a chart line needs.","fix":"Darken the orange and make the line thicker so profit stays visible on white."},{"id":"P4","note":"Red C3 #d62728 and gray C7 #666666 are same only in grayscale (difference 3.5); this matters for black-and-white printing and complete color blindness, not for red-, green- or blue-blind viewers (ok for all three).","fix":"If C7 is a gridline or axis near the sales line, make it lighter so the sales line stands out in a printed copy."}],"checks":["Which of the gray colors C5, C6 and C7 are axis labels or body text, and whether C7 at 5.74:1 is used for small text.","Whether the slide will be printed in grayscale, where P4 and P1 also merge.","After changing C4, that red, green and orange are still distinct in the simulator for all three types."]}

Errors

HTTPWhat to do
401The token is missing, expired or a guest token on a run. Get a personal token on the token page.
402The balance is below what the run reserves. Top up at skillsafe.ai/account/billing.
400The body is not a JSON object of the fields above.
429Wait and retry with the same Idempotency-Key.

Step 1 — a tiny client helper

One function that sends JSON and unwraps the {data, error} envelope.

BASE="https://api.skillsafe.ai/v1/app-api"
TOKEN="paste-your-token-here"   # from https://color-blindness-simulator.skillsafe.ai/tokens.html
api() { # api METHOD PATH [JSON-BODY]
  curl -s -X "$1" "$BASE$2" -H "Content-Type: application/json" \
    ${TOKEN:+-H "Authorization: Bearer $TOKEN"} ${3:+--data "$3"}
}

Step 2 — a token

A guest token is enough for /me and /estimate. A run is metered, so it needs your personal token: sign in on the token page and copy it.

# a guest token (enough for /me and /estimate); a run needs your personal token from /tokens.html
TOKEN=$(curl -s -X POST "$BASE/guest" -H "Content-Type: application/json" -d '{"slug":"color-blindness-simulator"}' | jq -r '.data.token')

Step 3 — who am I, and my balance

subject_type is guest or user; credits is the balance (1 credit = $0.0001).

api GET /me | jq '.data | {subject_type, credits}' 

Step 4 — price a run for free

/estimate charges nothing and starts no job. hold_credits is the amount reserved while a run is in flight, not the price; the run is charged what it uses.

# input.json: the run input object - {"task": "critique", "severity_pct": "100", "page_verdict": "major_issue", "colors": "[...]", "pairs": "[...]", "counts": "{...}", "note": "", "clipped_note": ""}
api POST /estimate "$(cat input.json)" | jq '.data | {hold_credits, min_credits, model, model_alias, markup_bps, warnings}' 

Step 5 — run it and wait for the job

Send an Idempotency-Key derived from the input: a retry with the same key is never billed twice.

KEY="color-blindness-simulator:critique:$(shasum -a 256 input.json | cut -c1-16):a1"
JOB=$(curl -s -X POST "$BASE/run" -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: $KEY" --data @input.json | jq -r '.data.job_id')
while :; do
  J=$(api GET "/jobs/$JOB"); S=$(echo "$J" | jq -r '.data.status')
  case "$S" in succeeded|failed|cancelled) break;; esac; sleep 2
done
echo "$J" | jq -r '.data.output.output' > reply.json   # one JSON object: verdict, summary, dimensions, pairs, checks
echo "$J" | jq '.data | {charged_credits, truncated}' 

Step 6 — or stream it

/run-stream sends Server-Sent Events while the job runs and the finished job at the end.

# Server-Sent Events: tick/delta events while the job runs, then a final event with the job
curl -N -s -X POST "$BASE/run-stream" -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: color-blindness-simulator:critique:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json