theme-engine
theme-engine resolves highlight capture names to concrete styles (fg/bg RGB + bold/italic/underline) with normalization and fallback.
Features
- Capture key normalization:
@commentandcommentresolve the same key.
- Hierarchical fallback:
comment.documentation -> comment -> normal
- UI-role resolution:
- supports optional
uimap (default_fg,default_bg,statusline,tab_active, etc.) - falls back to legacy
styleskeys for compatibility - exposes
default_terminal_colors()for terminal default fg/bg integration
- supports optional
- Built-in themes:
tokyonight-darktokyonight-moontokyonight-lighttokyonight-daysolarized-darksolarized-light
- Theme loading from JSON and TOML strings.
Quick Example
use load_theme;
default_terminal_colors() is designed to pair with terminal default-color escape sequences (OSC 10/11), for hosts that want theme-level foreground/background outside syntax spans.
Custom Theme Example
use Theme;