Skip to main content
Glama

WritersLogic verifiable AI agents

contrast-fix

WCAG 2.2 contrast check with the minimal OKLCH lightness fix and colour-blind pair check — Checks up to 50 foreground/background hex pairs against a WCAG 2.2 contrast threshold (4.5 AA text, 3 large text and UI, 7 AAA, or your own) on the unrounded ratio, so 4.499 fails and exactly 4.5 passes, and for a failing pair returns the closest colour by OKLCH lightness (chroma and hue held, gamut-clipped, 8-bit) that meets it. Optionally simulates protanomaly, deuteranomaly and tritanomaly (Mac

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "pairs": "<pairs>"
    },
    "name": "contrast-fix"
  }
}

Input Schema

NameRequiredDescriptionDefault
levelNoaa-normal 4.5 (default), aa-large 3, aaa-normal 7, aaa-large 4.5, non-text 3 (WCAG 2.2 SC 1.4.3, 1.4.6, 1.4.11).
pairsYesForeground/background pairs.
fixTargetNoWhich colour to move for a failing pair (default foreground); none skips the fix.
thresholdNoOverrides level: the minimum contrast ratio.
cvdSeverityNoEnables the colour-vision-deficiency check at this severity, 0 to 1 (1.0 is dichromacy); between the published 0.1 steps the matrices are interpolated.
cvdMinDeltaENoSmallest OKLab distance counted as distinguishable (default 0.05, a heuristic, not a standard).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources