code wiki / _hdl_build / nx_uiq_contrast.nx

nx_uiq_contrast.nx

buildroot/runtime/_hdl_build/nx_uiq_contrast.nx

2426 B43 linesdepth 6pulls 7 transitivereach 0 importersview sourcekind tooltopic uiq
docsdependenciesstructsconstsfunctions

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

nx_uiq_color.nx nx_uiq_contrast.nx

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

main uiq_w sys_write uiq_selftest sys_mmap uiq_ratio100 uiq_lum nx_f64_mul nx_f64_classify nx_f64_exp_field nx_f64_mant_field nx_f64_sign nx_f64_mant_field ↻ nx_f64_exp_field ↻ _f64_round_pack uiq_f64c nx_f64_div nx_f64_classify ↻ nx_f64_sign ↻ nx_f64_mant_field ↻ nx_f64_exp_field ↻ _f64_round_pack ↻ nx_i64_to_f64 _f64_round_pack ↻ uiq_srgb_lin uiq_f64c ↻ nx_f64_div ↻ nx_f64_add nx_f64_classify ↻ nx_f64_sign ↻ nx_f64_mant_field ↻ nx_f64_exp_field ↻ _f64_round_pack ↻ nx_f64_pow _pw_ycls sys_mmap ↻ _pw_log2m nx_f64_add ↻ nx_f64_mul ↻ nx_f64_sub

structs

none

consts

12const K_MAGIC_1048576: i64 = 1048576

functions

14func uic_slurp(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 1: sys_read
24func main(argc: i64, argv: *i64) -> i64