check_contrast
Check WCAG contrast ratio between two colors to ensure text readability against accent backgrounds. Pass foreground and background hex or rgb values to guard against unreadable combinations.
Instructions
Check the WCAG contrast ratio between two colours before shipping a theme.
Guards against unreadable text-on-accent: pass two colours -- as hex
(#d97706) or rgb()/rgba() -- such as a button's text vs. its
accent background, or body text vs. the page background. Use it on the
palette and accent from extract_brand when picking text colours.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| background | Yes | The colour behind it (hex or ``rgb()``). | |
| foreground | Yes | The text/foreground colour (hex or ``rgb()``). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||