Fix contrast (WCAG)
fix_contrastCompute the closest WCAG-compliant foreground color for a given background to achieve AA contrast (4.5:1).
Instructions
Compute the closest WCAG-compliant foreground color for a fg/bg pair (AA 4.5:1 normal text). Deterministic - no LLM.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bg | Yes | Background color: #rgb, #rrggbb or rgb(r,g,b) | |
| fg | Yes | Foreground color: #rgb, #rrggbb or rgb(r,g,b) | |
| target | No | Target contrast ratio (default 4.5, AA normal text) |