Documentation
¶
Overview ¶
Package theme owns the application color palette and the bridge from user config (a Theme struct deserialized from config.json) into the mutable lipgloss colors used by package ui. The visualizers package still has hardcoded colors today; migrating those to read from this palette is a separate piece of work.
Lipgloss styles capture their colors by value at construction time, so callers must construct/rebuild any styles that reference these vars AFTER Apply has run. The ui.RebuildStyles function in package ui takes care of that for the main UI palette.
Default returns the current palette as a Theme so first-time setup can write every overridable role to config.json. Validate checks every non-empty hex value before Apply, naming each offending path so users can fix typos without grepping the source.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Primary = lipgloss.AdaptiveColor{Light: "#874BFD", Dark: "#58f796"} Secondary = lipgloss.AdaptiveColor{Light: "#6232CC", Dark: "#b48eff"} Muted = lipgloss.AdaptiveColor{Light: "#9B9B9B", Dark: "#626262"} Subtle = lipgloss.AdaptiveColor{Light: "#6C6C6C", Dark: "#8a8a8a"} Dim = lipgloss.AdaptiveColor{Light: "#BCBCBC", Dark: "#444444"} Error = lipgloss.AdaptiveColor{Light: "#FF0000", Dark: "#ff0087"} Text = lipgloss.AdaptiveColor{Light: "#1a1a1a", Dark: "#dddddd"} TextDim = lipgloss.AdaptiveColor{Light: "#A49FA5", Dark: "#777777"} Tip = lipgloss.AdaptiveColor{Light: "#D4A017", Dark: "#FFD866"} OnPrimary = lipgloss.AdaptiveColor{Light: "#000000", Dark: "#000000"} GradientStart = lipgloss.AdaptiveColor{Light: "#e4d4f7", Dark: "#110a24"} GradientEnd = lipgloss.AdaptiveColor{Light: "#f8f5fc", Dark: "#040208"} )
Palette — exported, mutable. Reassigned by Apply at startup.
Functions ¶
Types ¶
type Theme ¶
type Theme struct {
Primary Variant `json:"primary,omitzero"`
Secondary Variant `json:"secondary,omitzero"`
Muted Variant `json:"muted,omitzero"`
Subtle Variant `json:"subtle,omitzero"`
Dim Variant `json:"dim,omitzero"`
Error Variant `json:"error,omitzero"`
Text Variant `json:"text,omitzero"`
TextDim Variant `json:"text_dim,omitzero"`
Tip Variant `json:"tip,omitzero"`
OnPrimary Variant `json:"on_primary,omitzero"`
GradientStart Variant `json:"gradient_start,omitzero"`
GradientEnd Variant `json:"gradient_end,omitzero"`
}
Theme is the user-overridable palette. Zero-valued entries preserve package defaults. omitzero (Go 1.24+) is used on the outer struct fields because omitempty is a no-op on struct values — it would emit the role even when fully empty.