Theme Structure
Termy themes are JSON files that define colors for the terminal UI. Each theme must include:- Foreground/Background: Primary text and terminal background colors
- Cursor: Cursor color
- ANSI Colors: Standard 16-color palette (black through bright_white)
Understanding the Theme Schema
Termy includes a JSON schema that validates theme files and provides autocomplete in compatible editors.Schema Format
All colors must be in 6-digit hex format:#RRGGBB
The schema enforces the pattern
^#[0-9a-fA-F]{6}$ for all color values. Invalid formats will be rejected.Required Color Keys
| Key | Description |
|---|---|
foreground | Default text color |
background | Terminal background color |
cursor | Cursor color |
black | ANSI color 0 |
red | ANSI color 1 |
green | ANSI color 2 |
yellow | ANSI color 3 |
blue | ANSI color 4 |
magenta | ANSI color 5 |
cyan | ANSI color 6 |
white | ANSI color 7 |
bright_black | ANSI color 8 (gray) |
bright_red | ANSI color 9 |
bright_green | ANSI color 10 |
bright_yellow | ANSI color 11 |
bright_blue | ANSI color 12 |
bright_magenta | ANSI color 13 |
bright_cyan | ANSI color 14 |
bright_white | ANSI color 15 |
Creating Your First Theme
Complete Theme Example
Here’s a complete custom theme:Importing Themes from Other Terminals
You can convert color schemes from other terminals to Termy’s format.From iTerm2
iTerm2 exports colors in XML format. Extract hex values and map them:- Foreground Color →
foreground - Background Color →
background - Cursor Color →
cursor - Ansi 0 Color →
black - Ansi 1 Color →
red - And so on…
From Alacritty
Alacritty uses YAML format:From Terminal.app
Export Terminal.app themes and extract RGB values, then convert to hex:When converting, ensure all hex values are uppercase or lowercase consistently for readability.
Applying Your Theme
Update Configuration
Edit Note: Use the filename without the
~/.config/termy/config.txt:.json extensionOverriding Theme Colors
You can override individual colors without creating a full theme:[colors] section supports:
- All theme color keys
- Color aliases like
fg(foreground),bg(background) - ANSI color numbers like
color0(black),color1(red)
Built-in Themes
Termy includes several built-in themes:- termy: Default Termy theme
- tokyo-night-dark: Popular dark theme with cool tones
- tokyo-night-light: Light variant of Tokyo Night
- clean-dark: Minimal dark theme with vibrant accents
- shadcn-dark: shadcn-inspired color palette
Theme Validation
Termy validates themes against the schema. Common errors:Invalid Hex Format
# prefix:
Wrong Hex Length
Missing Required Keys
If your theme is missing required colors, Termy will fall back to defaults or show validation errors.Use a JSON-aware editor with schema validation (VS Code, Sublime Text, etc.) to catch errors before applying the theme.
Color Palette Guidelines
Contrast Ratios
For readability, maintain good contrast:- Text on background: Aim for 7:1 ratio (WCAG AAA)
- Cursor on background: Should be clearly visible
- ANSI colors: Should be distinguishable from each other
Color Harmony
Consider using color theory:- Monochromatic: Variations of a single hue
- Analogous: Adjacent colors on the color wheel
- Complementary: Opposite colors for high contrast
Testing Your Theme
Test with real-world content:Sharing Your Theme
Share your theme with the community:- Upload your JSON file to a GitHub Gist
- Include a screenshot of your theme in action
- Document any special considerations (e.g., works best with specific fonts)
Troubleshooting
Theme Not Loading
Check file location:Colors Look Different
Ensure your display is calibrated and check:- Terminal opacity settings (
background_opacity) - Background blur (
background_blur) - System-level color profiles
Schema Validation Errors
If your editor shows schema errors:- Check that
$schemapath is correct relative to your theme file - Verify all colors match the
#RRGGBBformat - Ensure no extra or missing properties
Next Steps
- Explore Font Configuration to pair fonts with your theme
- Learn about Shell Integration for dynamic tab titles
- Check out Tmux Setup for advanced terminal workflows