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

Values

pub fn accent_style(t: Theme) -> style.Style

Accent text: accent on bg.

pub fn border_style(t: Theme) -> style.Style

Border color: border on bg.

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 error_style(t: Theme) -> style.Style

Error text: error color on bg, bold.

pub fn gruvbox_dark() -> Theme

Gruvbox Dark, retro groove dark palette. Inspired by the Gruvbox color scheme.

pub fn info_style(t: Theme) -> style.Style

Info text: info color on bg.

pub fn light() -> Theme

Generic light theme using ANSI 16-color palette.

pub fn monokai() -> Theme

Monokai, vibrant dark palette. Inspired by the Monokai color scheme.

pub fn muted_style(t: Theme) -> style.Style

Muted/secondary text: muted on bg.

pub fn nord() -> Theme

Nord, arctic, north-bluish dark palette. Original palette: https://www.nordtheme.com

pub fn normal(t: Theme) -> style.Style

Normal text: fg on bg.

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 success_style(t: Theme) -> style.Style

Success text: success color on bg.

pub fn title_style(t: Theme) -> style.Style

Title color: title on bg.

pub fn tokyo_night() -> Theme

Tokyo Night, dark cool-blue palette. Inspired by the Tokyo Night color scheme.

pub fn warning_style(t: Theme) -> style.Style

Warning text: warning color on bg.

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.

Search Document