calculate_perceptual_contrast
Checks text color contrast against background using WCAG 2.x and APCA to confirm accessibility and real readability.
Instructions
Measures color contrast between a text element and its background using both WCAG 2.x and APCA (WCAG 3.0 draft) formulas simultaneously. Use to answer: does this text pass accessibility contrast requirements? Is it actually readable even if it technically passes the legacy formula?
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": {
"url": "<url>",
"text_selector": "<text_selector>",
"background_selector": "<background_selector>"
},
"name": "calculate_perceptual_contrast"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL of the page to analyze | |
| viewport | No | Viewport size (default: 1280×720) | |
| text_selector | Yes | CSS selector for the text element | |
| background_selector | Yes | CSS selector for the background element |