DEV Community

J Now
J Now

Posted on

"# APCA per-role contrast gates and why WCAG lies on dark terminals\n\

"# APCA per-role contrast gates and why WCAG lies on dark terminals\n\nReading paragraphs of tool output for hours through a syntax-highlighting theme is the wrong pairing. Syntax themes optimize for token-level scanning; prose at body size needs different contrast targets. I kept noticing eye strain before I named the problem.\n\nI built four Terminal.app themes (klein-blue) around Yves Klein's IKB pigment, verified with APCA contrast gates per text role rather than a single WCAG ratio.\n\n## The asymmetry WCAG misses\n\nWCAG 2.1's contrast ratio is symmetric β€” same math for dark-on-light and light-on-dark. APCA is asymmetric because perception is. The same luminance delta reads differently depending on polarity, and terminal themes are always light text on dark ground.\n\nIKB on dark ground is the concrete case. The pigment's hex value produces APCA Lc -12 against near-black: effectively invisible. Some WCAG configurations pass this. APCA fails it, correctly.\n\nThe design fix: split blue across two ANSI slots by function, not aesthetics.\n\n

\nansi:blue pure IKB (Lc -12) # decorative only β€” Claude Code uses this for borders\nansi:blueBright A8BEF0 (passes Lc 60) # Claude Code uses this for permission-prompt text\n

\n\nBorders don't need to be read. Prompts do. Keeping the split means IKB stays unmixed where it's display-only, lifted only where it carries information.\n\n## Gate structure across four variations\n\n

\nbody >= Lc 90\nsubtle >= Lc 75\nmuted >= Lc 45\naccent >= Lc 60\n

\n\nKlein Void Prot (V3) passes all gates strictly. Klein Void Gallery trades some accent slots for maximum visual void. Klein Void Sand & Sea accepts the ansi:redBright brand color as a second hero; Klein Void Refined neutralizes it to keep a single-color interface.\n\nInstalls via bash install.sh to macOS Terminal.app, fully reversible via bash restore.sh. Requires the /theme picker set to dark-ansi β€” otherwise the ANSI palette is bypassed entirely.\n\nhttps://github.com/robertnowell/klein-void",

Top comments (0)