Commit 1115c2e
authored
feat: add Terminal (ANSI) theme preset that follows the terminal palette (#338)
## 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.2 files changed
Lines changed: 57 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
| |||
192 | 193 | | |
193 | 194 | | |
194 | 195 | | |
| 196 | + | |
195 | 197 | | |
196 | 198 | | |
197 | 199 | | |
| |||
209 | 211 | | |
210 | 212 | | |
211 | 213 | | |
| 214 | + | |
212 | 215 | | |
213 | 216 | | |
214 | 217 | | |
| |||
226 | 229 | | |
227 | 230 | | |
228 | 231 | | |
| 232 | + | |
229 | 233 | | |
230 | 234 | | |
231 | 235 | | |
| |||
262 | 266 | | |
263 | 267 | | |
264 | 268 | | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
265 | 292 | | |
266 | 293 | | |
267 | 294 | | |
| |||
1956 | 1983 | | |
1957 | 1984 | | |
1958 | 1985 | | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
1959 | 2015 | | |
1960 | 2016 | | |
1961 | 2017 | | |
| |||
0 commit comments