ThemePalette class

A semantic color palette for theming TUI applications.

Each property represents a semantic role (accent, success, error, etc.) rather than a specific color, allowing themes to be swapped easily.

Colors use AdaptiveColor to automatically adjust for light/dark terminal backgrounds.

final theme = ThemePalette.dark;
final style = Style().foreground(theme.accent);

Constructors

ThemePalette({required Color accent, required Color accentBold, required Color text, required Color textDim, required Color textBold, required Color border, required Color success, required Color warning, required Color error, required Color info, required Color highlight, Color? background})
Creates a custom theme palette.
const

Properties

accent Color
Primary accent color for active/selected elements.
final
accentBold Color
Bold variant of accent for titles and emphasis.
final
background Color?
Optional background color (null for default terminal background).
final
border Color
Border and separator color.
final
error Color
Error/danger indicator color (typically red).
final
hashCode int
The hash code for this object.
no setterinherited
highlight Color
Highlight/special color (typically purple/magenta).
final
info Color
Informational indicator color (typically blue).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
success Color
Success/positive indicator color (typically green).
final
text Color
Standard text color.
final
textBold Color
Bold/bright text color for emphasis.
final
textDim Color
Dimmed text color for secondary information.
final
warning Color
Warning indicator color (typically yellow/orange).
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

byName(String name) ThemePalette
Get a theme by name (case-insensitive).

Constants

dark → const ThemePalette
Dark theme - classic terminal colors on dark background.
dracula → const ThemePalette
Dracula theme - popular dark theme with purple accents.
hacker → const ThemePalette
Hacker theme - Matrix-inspired green-on-black aesthetic.
light → const ThemePalette
Light theme - darker colors for light terminal backgrounds.
monokai → const ThemePalette
Monokai theme - inspired by the popular editor theme.
names → const List<String>
Theme names corresponding to values.
nord → const ThemePalette
Nord theme - arctic, bluish color palette.
ocean → const ThemePalette
Ocean theme - calming blue/turquoise palette.
solarizedDark → const ThemePalette
Solarized Dark theme - ethan schoonover's popular color scheme.
solarizedLight → const ThemePalette
Solarized Light theme - light variant of solarized.
values → const List<ThemePalette>
All predefined themes.