Check color contrast
check_contrastCalculate the WCAG 2.2 contrast ratio between a text color and a background color and report whether it passes AA and AAA for normal text, large text and user interface components. Accepts hex, rgb(), rgba(), hsl() and CSS color names; a semi-transparent background is placed on white.
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 |
|---|---|---|---|
| locale | No | Language of the returned tool page link and of the text rules, one of: pl, en, de, es, fr, pt, it, cs, ar, id, tr, el, uk, ro, th, ja, vi, hi. Defaults to en. | |
| background | Yes | Background color, for example white. | |
| foreground | Yes | Text color, for example #555. |