Overview
Termy includes 13 built-in themes and supports custom themes via JSON files. Themes control:- Foreground and background colors
- Cursor color
- 16 ANSI colors (black, red, green, yellow, blue, magenta, cyan, white)
- Bright variants of all 8 base colors
Built-in Themes
Termy ships with these professionally designed themes:- Termy - Default Termy theme
- Tokyo Night - Popular dark theme with vibrant colors
- Catppuccin Mocha - Warm, pastel dark theme
- Dracula - Classic dark theme with purple accents
- Gruvbox Dark - Retro-inspired warm dark theme
- Nord - Arctic, north-bluish color palette
- Solarized Dark - Precision colors for optimal readability
- One Dark - Atom’s iconic dark theme
- Monokai - Sublime Text’s classic theme
- Material Dark - Google’s Material Design dark theme
- Palenight - Material theme variant with darker background
- Tomorrow Night - Clean, classic dark theme
- Oceanic Next - Cool, ocean-inspired color palette
crates/themes/src/.
Switching Themes
Use the theme switcher to change themes: Via Command Palette:- Open command palette
- Type “Switch Theme”
- Select from available themes
Theme Format
Termy uses a JSON-based theme format validated bytheme.schema.json.
Schema
Color Properties
| Property | Description | ANSI Code |
|---|---|---|
foreground | Default text color | - |
background | Terminal background | - |
cursor | Cursor color | - |
black | ANSI black | 30 |
red | ANSI red | 31 |
green | ANSI green | 32 |
yellow | ANSI yellow | 33 |
blue | ANSI blue | 34 |
magenta | ANSI magenta | 35 |
cyan | ANSI cyan | 36 |
white | ANSI white | 37 |
bright_black | ANSI bright black (gray) | 90 |
bright_red | ANSI bright red | 91 |
bright_green | ANSI bright green | 92 |
bright_yellow | ANSI bright yellow | 93 |
bright_blue | ANSI bright blue | 94 |
bright_magenta | ANSI bright magenta | 95 |
bright_cyan | ANSI bright cyan | 96 |
bright_white | ANSI bright white | 97 |
Color Format
All colors must be 6-digit RGB hex values:Creating Custom Themes
1. Create Theme File
Create a JSON file with your custom colors:2. Import Theme
Use the Import Colors command: Via Command Palette:- Open command palette
- Type “Import Colors”
- Select your JSON theme file
Imported themes are stored in your configuration and persist across sessions.
Theme Architecture
Termy’s theme system is implemented across several crates:Theme Core
Location:crates/theme_core/
Defines the core ThemeColors struct and theme ID handling:
Theme Registry
Location:crates/themes/src/lib.rs
Provides theme resolution and registration:
Global Registry
Themes are resolved through a global registry:Example: Tokyo Night Theme
Fromthemes/tokyo-night-dark.json:
Theme Normalization
Theme IDs are normalized for matching:"tokyo-night"→"tokyo-night""Tokyo Night"→"tokyo-night""TOKYO_NIGHT"→"tokyo-night"
Best Practices
Color Contrast
Ensure sufficient contrast between:- Foreground and background (minimum 4.5:1 ratio)
- ANSI colors and background
- Cursor and background
Testing
Test your theme with:Accessibility
Consider accessibility when creating themes:- Avoid red-green color combinations for critical information
- Provide sufficient brightness variation
- Test with colorblindness simulators
Troubleshooting
Theme Not Loading
If a custom theme doesn’t load:- Validate JSON: Ensure your JSON is well-formed
- Check Schema: All required fields must be present
- Color Format: Use 6-digit hex format (
#RRGGBB) - File Location: Verify the theme file is accessible
Colors Appear Wrong
If colors don’t match expectations:- Check TERM: Ensure
TERMsupports 256 colors - Test ANSI: Run ANSI color tests to verify rendering
- GPU Drivers: Update graphics drivers
- Theme Reload: Switch themes to force a reload
Related
- Configuration - Configure default theme
- GPU Acceleration - Theme rendering performance