Skip to content

feat: add Terminal (ANSI) theme preset that follows the terminal palette#338

Merged
LargeModGames merged 1 commit into
mainfrom
terminal-ansi-theme
Jul 5, 2026
Merged

feat: add Terminal (ANSI) theme preset that follows the terminal palette#338
LargeModGames merged 1 commit into
mainfrom
terminal-ansi-theme

Conversation

@LargeModGames

Copy link
Copy Markdown
Owner

Summary

Adds a Terminal (ANSI) theme preset built entirely from Color::Reset and named ANSI colors instead of hardcoded RGB. Since terminals remap already-rendered cells when their palette changes, terminal-theming tools like pywal recolor spotatui live, with no restart needed.

Closes #336

Details

  • New ThemePreset::Terminal variant wired into the five preset enumeration points (enum, all(), name(), from_name(), to_theme()). It mirrors the default cyan look using the terminal palette: Cyan accents, Red/LightRed errors, Yellow hints, Magenta hover, DarkGray inactive, and Reset for text/background.
  • No parser changes: parse_theme_item and color_to_string already round-trip named ANSI colors, so config persistence, settings-screen cycling, and live preview all work unchanged.
  • New test terminal_preset_colors_round_trip_through_config asserts every color in the preset survives serialize/parse (guards against a future Color::Indexed, which color_to_string silently collapses to Reset).
  • Changelog entry under Unreleased.

Testing

  • cargo fmt --all, cargo clippy --no-default-features --features telemetry -- -D warnings, and cargo test --no-default-features --features telemetry all pass (329 tests).
  • Manual: cycle Theme Preset to "Terminal (ANSI)" in Settings (Alt-,), then change the terminal palette (e.g. wal -i <image>) and confirm colors update without restarting.

Adds a theme preset built entirely from Color::Reset and named ANSI
colors instead of hardcoded RGB. Terminals remap already-rendered cells
when their palette changes, so terminal-theming tools like pywal
recolor spotatui live without a restart.

No parser changes needed: parse_theme_item and color_to_string already
round-trip named ANSI colors, so config persistence and the settings
live preview work unchanged. A new test guards that every color in the
preset survives the serialize/parse round trip.

Closes #336
@LargeModGames LargeModGames force-pushed the terminal-ansi-theme branch from ffaa570 to c9ea2ed Compare July 5, 2026 15:05
@LargeModGames LargeModGames merged commit 1115c2e into main Jul 5, 2026
15 checks passed
@LargeModGames LargeModGames deleted the terminal-ansi-theme branch July 5, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Theme Request

1 participant