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 ¶
- func Set(p Palette)
- type Palette
- func (p Palette) Accented() lipgloss.Style
- func (p Palette) ActiveTab() lipgloss.Style
- func (p Palette) Alert() lipgloss.Style
- func (p Palette) Dim() lipgloss.Style
- func (p Palette) Error() lipgloss.Style
- func (p Palette) Frame(focused bool) lipgloss.Style
- func (p Palette) Header() lipgloss.Style
- func (p Palette) Hint() lipgloss.Style
- func (p Palette) ModalBox(kind string) lipgloss.Style
- func (p Palette) OK() lipgloss.Style
- func (p Palette) Selected() lipgloss.Style
- func (p Palette) StatusBar() lipgloss.Style
- func (p Palette) Tab() lipgloss.Style
- func (p Palette) Title() lipgloss.Style
- func (p Palette) Toast() lipgloss.Style
- func (p Palette) Warn() lipgloss.Style
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 (Palette) ActiveTab ¶
ActiveTab returns the selected-tab style — inverse fg/bg in the accent colour.
func (Palette) Alert ¶
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) Frame ¶
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 ¶
Header is the table-header style — bold accent with a bottom border in the muted colour.
func (Palette) ModalBox ¶
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) Selected ¶
Selected is the highlight applied to the active row inside a table-style panel.
func (Palette) Title ¶
Title returns the bold accent style used for panel titles and section headers.