etui/theme
Types
Named color slots for a complete UI palette.
pub type Theme {
Theme(
bg: style.Color,
fg: style.Color,
border: style.Color,
title: style.Color,
selection_bg: style.Color,
selection_fg: style.Color,
accent: style.Color,
muted: style.Color,
error: style.Color,
warning: style.Color,
success: style.Color,
info: style.Color,
statusbar_bg: style.Color,
statusbar_fg: style.Color,
)
}
Constructors
-
Theme( bg: style.Color, fg: style.Color, border: style.Color, title: style.Color, selection_bg: style.Color, selection_fg: style.Color, accent: style.Color, muted: style.Color, error: style.Color, warning: style.Color, success: style.Color, info: style.Color, statusbar_bg: style.Color, statusbar_fg: style.Color, )Arguments
- bg
-
Main background.
- fg
-
Main foreground.
- border
-
Border lines.
- title
-
Border titles.
- selection_bg
-
Selected item background.
- selection_fg
-
Selected item foreground.
- accent
-
Primary accent (links, highlights, active elements).
- muted
-
Subdued/secondary text.
- error
-
Error messages.
- warning
-
Warnings.
- success
-
Success messages.
- info
-
Informational messages.
- statusbar_bg
-
Status bar background.
- statusbar_fg
-
Status bar foreground.
Values
pub fn catppuccin_latte() -> Theme
Catppuccin Latte, warm pastel light palette. Original palette: https://catppuccin.com
pub fn catppuccin_mocha() -> Theme
Catppuccin Mocha, warm pastel dark palette. Original palette: https://catppuccin.com
pub fn dark() -> Theme
Generic dark theme using ANSI 16-color palette. Works on every terminal, even without true-color support.
pub fn dracula() -> Theme
Dracula, dark purple palette. Original palette: https://draculatheme.com
pub fn gruvbox_dark() -> Theme
Gruvbox Dark, retro groove dark palette. Inspired by the Gruvbox color scheme.
pub fn monokai() -> Theme
Monokai, vibrant dark palette. Inspired by the Monokai color scheme.
pub fn nord() -> Theme
Nord, arctic, north-bluish dark palette. Original palette: https://www.nordtheme.com
pub fn selection(t: Theme) -> style.Style
Selected item: selection_fg on selection_bg.
pub fn solarized_dark() -> Theme
Solarized Dark, precision dark palette. Original palette by Ethan Schoonover.
pub fn statusbar_style(t: Theme) -> style.Style
Status bar: statusbar_fg on statusbar_bg.
pub fn tokyo_night() -> Theme
Tokyo Night, dark cool-blue palette. Inspired by the Tokyo Night color scheme.
pub fn with_accent(t: Theme, color: style.Color) -> Theme
Override individual fields on an existing theme. Use Gleam’s record update syntax directly:
let my = Theme(..theme.nord(), accent: style.Rgb(255, 165, 0))
These helpers cover common single-field tweaks. Replace the accent color.
pub fn with_base(
t: Theme,
bg: style.Color,
fg: style.Color,
) -> Theme
Replace main bg/fg.
pub fn with_selection(
t: Theme,
bg: style.Color,
fg: style.Color,
) -> Theme
Replace the selection colors.
pub fn with_statusbar(
t: Theme,
bg: style.Color,
fg: style.Color,
) -> Theme
Replace the status bar colors.