validate_theme_contrast
Ensure your designs meet WCAG accessibility standards by validating color contrast ratios. Enter foreground and background hex colors to determine if the contrast passes and get improvement recommendations.
Instructions
Validate color contrast ratio for WCAG compliance.
Use this tool to check if your color combinations meet accessibility standards before using them in designs.
Args: foreground: Foreground (text) color in hex format (e.g., "#000000") background: Background color in hex format (e.g., "#FFFFFF") wcag_level: Target WCAG level - "AA" or "AAA" text_size: Text size category - "normal" or "large" (large = 18pt+ or 14pt+ bold)
Returns: Dict containing: - passes: Boolean indicating if contrast meets requirements - ratio: Calculated contrast ratio (e.g., 7.5) - required_ratio: Minimum required ratio for the level/size - message: Human-readable result message - recommendations: Suggestions if contrast fails
Example: validate_theme_contrast( foreground="#FFFFFF", background="#3B82F6", # blue-500 wcag_level="AA" )
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text_size | No | normal | |
| background | Yes | ||
| foreground | Yes | ||
| wcag_level | No | AA |