Check a color pair
check_contrastCalculates the WCAG contrast ratio between foreground and background colors and verifies if it passes AA or AAA for the given text size and weight.
Instructions
Calculate the WCAG contrast ratio for foreground and background colors and determine whether the pair passes for the supplied text size and weight.
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 |
|---|---|---|---|
| level | No | AA | |
| background | Yes | Background CSS sRGB color such as white, #ffffff, rgb(), hsl(), or color(srgb ...). | |
| fontSizePx | No | ||
| fontWeight | No | ||
| foreground | Yes | Foreground CSS sRGB color such as white, #767676, rgb(), hsl(), or color(srgb ...). |