Terminal applications use a palette-based color system that adapts to user preferences. Unlike web applications with fixed hex colors, terminal colors are semantic references that get translated by the terminal emulator.
Instead of saying "use #00FF00", we say "use green". The terminal decides what "green" means based on the user's theme.
| Semantic Name | Typical Usage | Meaning |
|---|---|---|
| primary | Main content text | The most important text |
| secondary | Supporting text | Less important information |
| accent | Interactive elements | Draws attention, clickable |
| success | Positive states | Operation succeeded |
| warning | Caution needed | Requires attention |
| error | Problems/failures | Something went wrong |
| muted | De-emphasized | Background information |
| selected | Current selection | Active/focused item |
| disabled | Unavailable | Cannot be interacted with |
const semanticColors = {
primary: 'white', // Main text
secondary: 'gray', // Supporting text
accent: 'cyan', // Interactive/special
success: 'green', // Positive feedback
warning: 'yellow', // Attention needed
error: 'red', // Errors/problems
muted: 'gray+dim', // Background info
selected: 'cyan', // Current selection
disabled: 'gray+dim', // Unavailable items
info: 'blue', // Informational
}These semantic colors automatically adapt:
| Semantic | Dark Terminal | Light Terminal |
|---|---|---|
| primary | Light gray/white | Dark gray/black |
| secondary | Medium gray | Medium gray |
| accent | Bright cyan | Dark cyan |
| muted | Dim gray | Light gray |
Best way to communicate:
- "Make the heading use primary color"
- "Change selected items to accent color"
- "Use muted for timestamps"
- "Show errors in error color"
- "Make disabled items muted"
Why this works:
- Clear intent
- Theme-agnostic
- Consistent meaning
- Easy to understand
Purpose-based communication:
- "Make it stand out more" → Use accent or primary
- "Make it less prominent" → Use muted or secondary
- "Show it's interactive" → Use accent
- "Show it's dangerous" → Use error
- "Show it needs attention" → Use warning
When specific colors are needed:
- "Use cyan for links" (when matching a convention)
- "Make private repos yellow" (specific to GitHub)
- "Use the language color from GitHub" (external data)
Don't use:
- "Make it #00FFFF"
- "Use RGB(0, 255, 255)"
- "Make it exactly this shade"
// Semantic description:
{
number: 'muted', // "12."
name: 'primary', // "owner/repo"
private: 'warning', // "Private" badge
archived: 'muted', // "Archived" badge
selected: 'accent', // When highlighted
description: 'secondary', // Repo description
metadata: 'muted', // Stars, language, date
}How to communicate this:
- "Use primary for repo names"
- "Make numbers muted"
- "Show private badge as warning"
- "Selected items should be accent"
{
loading: 'warning', // "Loading..."
success: 'success', // "✓ Completed"
error: 'error', // "✗ Failed"
info: 'info', // "ℹ 50 repos found"
}How to communicate:
- "Show loading state as warning"
- "Success messages in success color"
- "Error messages in error color"
// Define semantic mappings
const colors = {
primary: undefined, // Use terminal default
secondary: 'gray',
accent: 'cyan',
muted: 'gray',
error: 'red',
warning: 'yellow',
success: 'green',
};
// Use semantically
<Text color={colors.primary}>Repository Name</Text>
<Text color={colors.muted} dimColor>Updated 2 days ago</Text>
<Text color={colors.accent}>→ Selected Item</Text>// Emphasis levels
<Text color={colors.primary} bold>Very Important</Text>
<Text color={colors.primary}>Normal Important</Text>
<Text color={colors.secondary}>Less Important</Text>
<Text color={colors.muted} dimColor>Least Important</Text>| Say This | Maps To | Use For |
|---|---|---|
| primary | white or undefined |
Main content |
| secondary | gray |
Supporting info |
| accent | cyan |
Interactive/special |
| muted | gray + dimColor |
Background info |
| success | green |
Positive states |
| warning | yellow |
Needs attention |
| error | red |
Problems |
| info | blue |
Information |
| selected | cyan + bold |
Current selection |
Instead of: "Make the text #888888" Say: "Make the text secondary"
Instead of: "Use bright blue" Say: "Use accent color"
Instead of: "Make it darker" Say: "Make it muted"
Instead of: "Make it pop" Say: "Make it accent with bold"
Instead of: "The gray is too light" Say: "The secondary text needs more contrast"
Instead of: "Can't see the selection" Say: "The selected state needs to be more prominent"
Instead of: "Too many colors" Say: "Simplify to primary and secondary only"
- Theme Independence: Works with any terminal theme
- Accessibility: Users can adjust their terminal for their needs
- Consistency: Same semantic meaning everywhere
- Maintenance: Easy to update color scheme globally
- Communication: Clear intent without technical details
When discussing colors, think about what the color means, not what it looks like:
- Primary: Most important
- Secondary: Supporting
- Accent: Special/interactive
- Muted: De-emphasized
- Success/Warning/Error: States
This semantic approach ensures your terminal UI looks good in any theme and is accessible to all users.