Add TermColor, TermSpan, TermLine, TermOutput types to litmus-model (litmus-q9lp)
Add the new terminal output types to litmus-model:
- TermColor enum: Default, Ansi(u8), Indexed(u8), Rgb(u8, u8, u8)
- TermSpan: text + fg/bg TermColor + bold/italic/dim/underline
- TermLine: Vec
- TermOutput: id, name, cols, rows, Vec
- Serde JSON serialization/deserialization for all types
- TermColor resolution method: resolve(provider_colors) → CSS-ready rgb values
- Indexed(16-255) → fixed RGB lookup table (standard 256-color palette)
Keep existing Scene/ThemeColor types — removed in a later task.
Plan
New file: crates/litmus-model/src/term_output.rs
TermColorenum: Default, Ansi(u8), Indexed(u8), Rgb(u8, u8, u8)TermColor::resolve()method: takes ProviderColors, returns Color- Default → uses context (caller decides fg vs bg)
- Ansi(0-15) → ProviderColors.ansi lookup
- Indexed(16-255) → fixed 256-color palette lookup table
- Rgb → direct Color
TermSpan: text + fg/bg TermColor + bold/italic/dim/underlineTermLine: VecTermOutput: id, name, cols, rows, Vec- Serde JSON serialization/deserialization for all types
256-color palette
Standard xterm-256 color palette: colors 16-231 are a 6x6x6 color cube, 232-255 are grayscale.
Commits
- Tests + implementation
- Review fixes
Summary of Changes
Added term_output module to litmus-model with:
TermColorenum: Default, Ansi(0-15), Indexed(16-255), Rgb(r,g,b) with tagged serdeTermColor::resolve(): maps to concrete Color via ProviderColors + default fallback- Standard xterm-256 color palette: 6x6x6 cube (16-231) + grayscale ramp (232-255)
TermSpan: text + fg/bg TermColor + bold/italic/dim/underline with skip_serializing_ifTermLineandTermOutput: structured parsed terminal output- 11 tests covering resolution, palette corners, and JSON serde round-trips
Existing Scene/ThemeColor types kept intact.