Contrast
check_contrastCheck color contrast. Give fg and bg, or pairs (a list of {fg, bg, label, sizePx, bold}), or a palette. Returns the WCAG 2.2 ratio with AA and AAA results for the text size, APCA Lc with what it is enough for, the nearest passing color, and for palettes the color pairs that become indistinguishable under protanopia, deuteranopia or tritanopia. Accepts hex, rgb(), hsl() and CSS names.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bg | No | Background color | |
| fg | No | Foreground color | |
| bold | No | True if the text is bold, which changes the large-text threshold | |
| pairs | No | Several pairs at once | |
| sizePx | No | Text size in CSS px, default 16 | |
| palette | No | Colors to test against white, black and each other under color blindness |