Expand description
UI theme (DESIGN.md §5.6, §5.12).
Holds the customizable styling knobs the renderer reads each
frame. v1 ships a built-in default that matches vim’s classic
split visuals (active status line reverse-videoed, inactive
dim, vertical separator with │); every field is exposed via
:set ui.* options so a user / config layer can override it.
Adding a new themable surface is two edits: add a field to
Theme with its default + add an OptionSpec in
crate::options::builtin_options() that mutates that field.
Structs§
- Theme
- One full UI theme. Cheap to clone (Style + char fields are all
Copy); the App holds it directly and:set ui.*writes through.
Functions§
- build_
tui_ theme - Build the ratatui-typed
Themecache from the resolved theme table plus the non-styleui.*typed options. The TUI’sApp.themecache is the renderer’s hot-path adapted view; it is rebuilt at theme-change / option-set rate, never per frame. - diagnostic_
glyph_ and_ style - Resolve the per-severity rendering bits from the theme.
Returns
(glyph, style). - host_
color_ to_ ratatui - Adapt a renderer-neutral
host_theme::Colorinto a ratatui [Color]. Lossless on all variants exceptRgbwhen the terminal doesn’t support truecolor – in that case the renderer’s frame submission stage handles the lossy fallback (ratatui already does palette closest-match itself). - host_
style_ to_ ratatui - Adapt a renderer-neutral
host_theme::Styleinto a ratatui [Style]. Empty fg/bg map to “unset” on the ratatui side (same asStyle::default()); modifiers chain viaadd_modifier. - parse_
color - Parse a user-typed color name into a ratatui [
Color].