suggest_contrast_fix
Given failing WCAG contrast pairs, compute the smallest color change to reach AA/AAA. Outputs alternate foreground or background values with achieved ratios.
Instructions
Given failing WCAG color pairs, return the MINIMAL color change that clears the target ratio. For each {fg,bg} pair, computes the smallest foreground adjustment (and an alternative background adjustment) that reaches AA/AAA — with the achieved ratio and direction. Feeds directly from audit_contrast's failing pairs: pass them here to get concrete passing values instead of brute-forcing colors by hand. Pure offline math.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "suggest_contrast_fix"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| level | No | WCAG level when targetRatio is not given per-pair. Default AA. | |
| pairs | No | Color pairs to remediate. Each: { selector?, fg, bg, fontPx?, bold?, targetRatio? }. fontPx/bold pick the large-text threshold; targetRatio overrides the level. |