Update contrast validation for TermColor (litmus-bcel)
Update contrast validation to work with TermOutput instead of Scene:
- TermColor::Default and Ansi(0-15) pairs: validate against theme palette (same as before)
- TermColor::Indexed/Rgb vs Default/Ansi: validate fixed color against theme-dependent counterpart
- TermColor::Indexed/Rgb vs Indexed/Rgb: skip (both fixed, theme-independent)
- New insight: can flag “this fixture uses hardcoded colors that clash with this theme’s background”
- Update ReadabilityIssue to reference TermSpan positions
Depends on: TermOutput types, web rendering migration
Plan
- Add
TermContrastIssuestruct (references fixture_id and TermColor variants) - Add
validate_term_output_contrast(output: &TermOutput, theme: &Theme)function - Skip pairs where both fg and bg are fixed (Indexed/Rgb vs Indexed/Rgb)
- Validate all other pairs using APCA
- Add
validate_all_fixtures_contrast(fixtures: &[TermOutput], theme: &Theme)convenience - Tests: low-contrast detection, skip-fixed-pairs, dim exclusion
Summary of Changes
- Added
TermContrastIssuestruct with fixture_id and TermColor variant fields - Added
validate_term_output_contrast()— validates TermOutput spans using APCA- Skips fixed-color pairs (Indexed/Rgb vs Indexed/Rgb)
- Skips Default/Default pairs (theme-controlled)
- Skips dim and whitespace-only spans
- Added
validate_fixtures_contrast()— aggregates across multiple fixtures - 7 tests: ANSI detection, fixed-pair skip, fixed-on-theme, dim skip, default/default skip, Ansi-on-Ansi bg, multi-fixture aggregation
Commits: f868232, 53b2a5e