Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Themes

TUI theming is implemented in crates/tui/src/theme/theme.rs with terminal palette support in crates/tui/src/theme/terminal.rs.

Built-in Themes

Recognized names:

  • auto (alias of terminal-adaptive mode)
  • terminal
  • default (alias of terminal-adaptive mode)
  • dark
  • light
  • dracula
  • nord
  • gruvbox
  • gruvbox-dark (alias of gruvbox)

ThemeChoice::names() surfaces: auto, dark, light, dracula, nord, gruvbox.

Configure Theme

[tui]
theme = "nord"
frame_rate_cap = 60

Semantic Color Keys

Swarmie exposes 15 semantic color keys (Theme and [tui.colors]):

  • primary
  • success
  • error
  • warning
  • muted
  • accent
  • text
  • bg_subtle
  • border
  • spinner
  • text_weak
  • text_strong
  • border_focus
  • info
  • background

Color Overrides

Use [tui.colors] to override any subset of semantic colors:

[tui]
theme = "terminal"
 
[tui.colors]
primary = "#f97316"
accent = "#60a5fa"
text = "#e5e7eb"
bg_subtle = "#1f2937"
border_focus = "#f97316"

Terminal-Adaptive Mode

terminal/auto mode queries terminal foreground/background via OSC color detection and derives readable colors at runtime.

Capabilities from crates/tui/src/theme/terminal.rs:

  • Detect terminal light/dark tendency.
  • Refresh palette on re-query.
  • Best-effort downgrade for truecolor/256/16-color terminals.
  • Blend and perceptual color distance helpers used for adaptive selection.

If terminal palette detection fails, Swarmie falls back to safe defaults.