TCA Rust
March 28, 2026 ยท View on GitHub
Terminal Colors Architecture (TCA) for Rust: consistent, user-configurable theming for terminal applications.
For Developers
Add one line to your app and get beautiful theming with zero configuration:
let theme = TcaTheme::default();
Your app immediately works with 11 built-in themes and any theme the user installs. You don't have to ship themes or write config parsers - TCA handles it.
// Use resolved colors directly in ratatui
let style = Style::default()
.fg(theme.ui.fg_primary)
.bg(theme.ui.bg_primary);
let error_style = Style::default().fg(theme.semantic.error);
let border_style = Style::default().fg(theme.ui.border_primary);
For Users
Drop any .yaml theme file into ~/.local/share/tca/themes/ and it becomes available to every TCA-powered app on the system with no per-app configuration needed.
# Install a theme from the tca-themes collection
cp tokyo-night.yaml ~/.local/share/tca/themes/
# Your app picks it up automatically
myapp --theme tokyo-night
Browse available themes at tca-themes.
How Theme Resolution Works
TcaTheme::new(Some("name")) tries each step in order, falling back gracefully:
- User theme files - searches
~/.local/share/tca/themes/<name>.yaml, or accepts an exact file path - Built-in themes - catppuccin-mocha, cyberpunk, dracula, everforest-dark, gruvbox-dark, mono, nord, one-dark, rose-pine, solarized-light, tokyo-night
- User preference - reads
~/.config/tca/tca.tomlfor a configured default - Auto-detect - picks a dark or light built-in based on the terminal's background color
Passing None skips steps 1-2 and goes straight to the user's preference or auto-detection.
Packages
| Crate | Purpose |
|---|---|
| tca-ratatui | Ratatui integration - TcaTheme, widgets |
| tca-types | Core types and base24 YAML parsing |
| tca-cli | CLI โ validate, add, list, init |
Getting Started
[dependencies]
tca-ratatui = "0.6"
use tca_ratatui::TcaTheme;
use ratatui::style::Style;
let theme = TcaTheme::new(None);
That's it. See tca-ratatui for the full guide.
Development
cargo build --workspace
cargo test --workspace
cargo clippy --workspace
Related
- tca-themes - community theme collection
- tca-go - Go implementation
- tca-python - Python implementation
License
MIT