code wiki / _hdl_build / nx_uiq_contrast.nx
nx_uiq_contrast.nx
buildroot/runtime/_hdl_build/nx_uiq_contrast.nx
about
nx_uiq_contrast.nx -- CLI: FULL-PAGE COMPUTED WCAG 2.x contrast auditor over REAL extracted colors.
The quantitative fix for the "presence != conformance" gap: nx_ui_contrast checked ONE hardcoded token
pair on 6 hardcoded pages; this parses ANY page, extracts every --custom-property color, and computes
the real WCAG ratio for every text-role x surface-role pair -> the failures the presence-judge misses.
usage: nx_uiq_contrast --kat (self-test: math + parser + non-vacuous audit)
nx_uiq_contrast <html-file-path> (emits JSON: tokens, failing pairs, ratios, verdict)
HONEST ENVELOPE: static/source-measured over declared color tokens; role pairing is a name heuristic;
true rendered element-on-background stacking + non-text (3:1) + large-text (3:1) tiers = browser-lane.
Automated contrast is one axe rule; automated a11y covers ~57% of ISSUES / ~30-40% of WCAG SC (a FLOOR,
never proof of conformance). license_tier: ORIGINAL expect_exit: 0 genealogy: w3.org/TR/WCAG21
dependencies 1 imports · 0 importers
imports: nx_uiq_color.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 12 | const K_MAGIC_1048576: i64 = 1048576 |
functions
| 14 | func uic_slurp(path: *u8, buf: *u8, cap: i64) -> i64 |
| 24 | func main(argc: i64, argv: *i64) -> i64 |