Documentation
¶
Overview ¶
Package theme defines the color system for the UI. A theme is derived from a compact Palette so that built-in themes are pure data.
Index ¶
Constants ¶
View Source
const DefaultName = "sorbet"
DefaultName is the name of the palette used when no theme is configured.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Palette ¶
type Palette struct {
Name string
Bg string // main background (kept for contrast fills, e.g. text on tags)
Fg string // main text
BgSoft string // alternating row / status-bar / subtle panel background
FgDim string // dimmed text (gutter, placeholders, borders)
Header string // table header foreground
Accent string // primary accent (selection background)
AccentFg string // text on top of Accent
Highlight string // search-match / emphasis foreground
Error string
Warning string
Success string
// Series colors used for status-bar tags and plot groups; at least 4.
Series []string
}
Palette is the raw color definition of a theme. All colors are hex strings like "#1e1e2e".
type Theme ¶
type Theme struct {
Palette Palette
// base
Text lipgloss.Style
Subtle lipgloss.Style
Error lipgloss.Style
Warning lipgloss.Style
Success lipgloss.Style
// table
Header lipgloss.Style
RowEven lipgloss.Style
RowOdd lipgloss.Style
RowSelected lipgloss.Style
ColCursor lipgloss.Style // current column header cursor (soft highlight)
Gutter lipgloss.Style
Border lipgloss.Style
Match lipgloss.Style // search-match cell emphasis
// status bar
StatusBar lipgloss.Style
// popups / prompts
PopupBorder lipgloss.Style
PopupTitle lipgloss.Style
ListItem lipgloss.Style
ListSelected lipgloss.Style
Input lipgloss.Style
Placeholder lipgloss.Style
}
Theme holds ready-to-use styles derived from a Palette.
func Builtin ¶
Builtin returns the derived Theme for a built-in palette name. The lookup is case-insensitive and ignores surrounding whitespace. Derived themes are cached, so repeated lookups are cheap.
Click to show internal directories.
Click to hide internal directories.