Check and adjust a text color
check_contrastCalculate WCAG 2 contrast between two opaque sRGB hex colors and suggest a foreground shade that meets a required 3:1, 4.5:1, or 7:1 threshold when possible.
Instructions
Calculate WCAG 2 contrast for two opaque sRGB hex colors and suggest a foreground shade at the requested minimum if possible.
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": {
"foreground": "<foreground>",
"background": "<background>"
},
"name": "check_contrast"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| threshold | No | ||
| background | Yes | ||
| foreground | Yes |