Expand description
Case 1 — contrast guard for text-on-surface pairings.
The client’s requested text color is treated as a suggestion. When it fails AA against the surface, the engine substitutes a guaranteed-readable text color rather than emit unreadable HTML. The rejected color is never destroyed — callers may still place it on a border or divider.
Functions§
- readable_
text - Pick whichever of the two default text colors reads best on
surface. Used both as the fallback insideresolve_text_tokenand as a direct utility for “I just need text that works”. - resolve_
text_ token - If
requestedclears AA onsurface, return it. Otherwise log a warning and substitutereadable_text.