Check Color Contrast (WCAG)
ui_check_color_contrastCheck WCAG 2.1 color contrast ratios between text and background colors, then get pass/fail results for AA and AAA standards with actionable fixes.
Instructions
Check the WCAG 2.1 color contrast ratio between a foreground and background color.
Evaluates against WCAG AA (4.5:1 for normal text, 3:1 for large text) and AAA (7:1 for normal text, 4.5:1 for large text) standards.
Args:
foreground (string): Foreground/text hex color (e.g. "#333333")
background (string): Background hex color (e.g. "#FFFFFF")
response_format (string, optional): 'markdown' or 'json'. Default: 'markdown'
Returns: Contrast ratio, pass/fail for each WCAG level, overall grade, and actionable recommendations.
Examples:
Check dark text on white: foreground="#1A1A2E", background="#FFFFFF"
Check white text on blue: foreground="#FFFFFF", background="#3B82F6"
Check if a muted gray passes: foreground="#888888", background="#FFFFFF"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| background | Yes | Background hex color (e.g. '#FFFFFF' or 'FFFFFF') | |
| foreground | Yes | Foreground/text hex color (e.g. '#333333' or '333333') | |
| response_format | No | Output format | markdown |