Documentation
¶
Overview ¶
Package theme is the semantic palette layer (doc 02 section 10, D18). A theme author fills in around thirty semantic colors; a pure expansion turns them into every component style the UI draws with. No widget constructs a color inline, which is what makes light and dark a property of the palette rather than a fork of the rendering code.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DiffStyle ¶
type DiffStyle struct {
Add, Del lipgloss.Style // whole-line backgrounds
AddEmph, DelEmph lipgloss.Style // intra-line emphasis
GutterAdd lipgloss.Style
GutterDel lipgloss.Style
LineNo lipgloss.Style
Context lipgloss.Style
Header lipgloss.Style
}
DiffStyle is the style set the diff renderer pulls from the theme (doc 02 section 9.2).
type Palette ¶
type Palette struct {
// Brand and accent.
Primary, Secondary, Accent, Keyword color.Color
// Foreground ramp: from brightest text to faintest.
FgBase, FgMuted, FgSubtle, FgFaint color.Color
// Background ramp: base, raised panels, overlays, selection.
BgBase, BgRaised, BgOverlay, BgSelection color.Color
// Status.
Success, Warning, Error, Info color.Color
// Diff.
DiffAdd, DiffDel, DiffAddEmph, DiffDelEmph color.Color
// The ANSI-16 remap for embedded shell output.
ANSI [16]color.Color
// Dark reports whether this palette targets a dark terminal.
Dark bool
}
Palette is the semantic color set a theme author fills in. Everything the UI draws derives from these colors; no component hardcodes one.
type Styles ¶
type Styles struct {
// Prose.
Base, Muted, Subtle, Faint lipgloss.Style
// Chat surfaces.
UserPrompt lipgloss.Style // the user's own text
Reasoning lipgloss.Style // model thinking, dim
ToolName lipgloss.Style
ToolInput lipgloss.Style
ToolOutput lipgloss.Style
ToolErr lipgloss.Style
// Status.
Success, Warning, Error, Info lipgloss.Style
// Chrome.
Title lipgloss.Style
Border lipgloss.Style
Selected lipgloss.Style
// Sub-system configs derived from the same palette (doc 02
// section 10.4).
Diff DiffStyle
Markdown ansi.StyleConfig // glamour
Chroma *chroma.Style // syntax highlighting
}
Styles is the expanded form of a palette: one field per component surface. Widgets read these; nothing else colors anything.