check_contrast
Check if text, buttons, links, and images meet WCAG contrast ratios (4.5:1 for text, 3:1 for graphics) and report each failing element with its ratio and colors.
Instructions
Check that text, buttons, links and images stand out from their background: WCAG's 4.5:1 for text (3 for large text) and 3:1 for images unless text_ratio and graphics say otherwise, and with edges, a button's or field's edge too. It raises the window and measures a picture of the screen in each node's bounds. The answer: each node that fails, a tree line with bounds, its ratio and colors, or "No problems."; then what it couldn't measure, which doesn't fail (too small, or GTK 4's, whose positions are wrong), and why. A window where nothing can be measured, as GTK 4's, is an error, not a pass. Switches, sliders, check boxes, disabled nodes and what's scrolled out of view are skipped. For missing names, use check_accessible_names.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edges | No | Least for edges (unchecked) | |
| ignore | No | Regexes for lines that can't be fixed yet | |
| window | No | A window's title, exactly or a regex matched in full, or app=RE for its app id | |
| session | Yes | Its name, from start_session | |
| graphics | No | Least for images (3) | |
| text_ratio | No | Least for text (4.5) |