theme

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package theme owns the TUI's semantic colour palette and the derived high-level lipgloss styles. Panels read from theme.Theme() instead of hard-coding lipgloss.Color("…") literals so colour decisions stay in one place and a future light-mode palette is a one-line swap.

The package lives outside internal/tui so internal/tui/panels can import it without an import cycle.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Set

func Set(p Palette)

Set swaps the active palette. Pass MonochromePalette() to strip colour, DarkPalette() to restore.

Types

type Palette

type Palette struct {
	Fg          lipgloss.Color
	FgMuted     lipgloss.Color
	BgAlt       lipgloss.Color
	Accent      lipgloss.Color
	Success     lipgloss.Color
	Warning     lipgloss.Color
	Danger      lipgloss.Color
	Info        lipgloss.Color
	Border      lipgloss.Color
	BorderFocus lipgloss.Color
	SelectBg    lipgloss.Color
	ToastBg     lipgloss.Color
}

Palette is the semantic colour set. Field names describe *role*, not hue — Accent is the canonical highlight colour, Danger is reserved for destructive/error surfaces, etc.

func DarkPalette

func DarkPalette() Palette

DarkPalette is the default 256-colour palette tuned for dark terminals. Numbers map to xterm-256: 39 (dodger blue), 42 (green), 196 (red), 220 (yellow), 245 (light grey), 240 (mid grey), 236 (charcoal), 231 (white), 88 (dark red — for toast bg), 57 (purple — for selected row bg).

func MonochromePalette

func MonochromePalette() Palette

MonochromePalette is used when --no-color is passed or stdout isn't a TTY. Every role collapses to default fg/bg so lipgloss emits no ANSI.

func Theme

func Theme() Palette

Theme returns the active palette. Always non-nil.

func (Palette) Accented

func (p Palette) Accented() lipgloss.Style

Accented returns a bold-accent inline style.

func (Palette) ActiveTab

func (p Palette) ActiveTab() lipgloss.Style

ActiveTab returns the selected-tab style — inverse fg/bg in the accent colour.

func (Palette) Alert

func (p Palette) Alert() lipgloss.Style

Alert is the bold danger style used for tone-alert-style attention callouts. Same hue as Error but with weight to differentiate from a passive error indicator.

func (Palette) Dim

func (p Palette) Dim() lipgloss.Style

Dim is the muted-foreground style for de-emphasised text.

func (Palette) Error

func (p Palette) Error() lipgloss.Style

Error is the danger-coloured inline style for error indicators.

func (Palette) Frame

func (p Palette) Frame(focused bool) lipgloss.Style

Frame returns the rounded border style, accenting the border colour when focused. Named Frame rather than Border so it doesn't collide with the Border colour field.

func (Palette) Header

func (p Palette) Header() lipgloss.Style

Header is the table-header style — bold accent with a bottom border in the muted colour.

func (Palette) Hint

func (p Palette) Hint() lipgloss.Style

Hint is the dim helper-text style used in footers and inline usage hints.

func (Palette) ModalBox

func (p Palette) ModalBox(kind string) lipgloss.Style

ModalBox returns the modal-window styling shared by the confirm and detail modals. kind is one of "danger" / "info"; kind == "danger" uses the Danger border colour (red), anything else uses Accent.

func (Palette) OK

func (p Palette) OK() lipgloss.Style

OK returns the success-coloured inline style for "● ok" indicators.

func (Palette) Selected

func (p Palette) Selected() lipgloss.Style

Selected is the highlight applied to the active row inside a table-style panel.

func (Palette) StatusBar

func (p Palette) StatusBar() lipgloss.Style

StatusBar returns the status-bar background style.

func (Palette) Tab

func (p Palette) Tab() lipgloss.Style

Tab returns an unselected-tab style.

func (Palette) Title

func (p Palette) Title() lipgloss.Style

Title returns the bold accent style used for panel titles and section headers.

func (Palette) Toast

func (p Palette) Toast() lipgloss.Style

Toast returns the inline notification style — white on dark-red.

func (Palette) Warn

func (p Palette) Warn() lipgloss.Style

Warn is the warning-coloured inline style — used for in-progress / transient states like "hunting".

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL