Documentation
¶
Overview ¶
Package theme provides color palettes, precomputed lipgloss styles, and Tree-sitter syntax capture mappings for Diffmantic themes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionColors ¶
type ActionColors struct {
DeleteFg lipgloss.Color
InsertFg lipgloss.Color
UpdateFg lipgloss.Color
MoveFg lipgloss.Color
MoveUpdateFg lipgloss.Color
DeleteBg lipgloss.Color
InsertBg lipgloss.Color
UpdateBg lipgloss.Color
MoveBg lipgloss.Color
MoveUpdateBg lipgloss.Color
}
ActionColors contains the dedicated diff action foregrounds and background tints.
type ActionKind ¶
type ActionKind int
ActionKind dictates how a diff action or line is styled.
const ( // ActionDelete styles deleted content or lines. ActionDelete ActionKind = iota // ActionInsert styles inserted content or lines. ActionInsert // ActionUpdate styles updated/modified content. ActionUpdate // ActionMove styles moved AST nodes. ActionMove // ActionMoveUpdate styles moved and simultaneously modified content. ActionMoveUpdate )
type Styles ¶
type Styles struct {
Title lipgloss.Style
Status lipgloss.Style
LineNum lipgloss.Style
GutterFold lipgloss.Style
Content lipgloss.Style
SearchHl lipgloss.Style
SearchActiveHl lipgloss.Style
Divider lipgloss.Style
Fold lipgloss.Style
CursorGutter lipgloss.Style
CursorContent lipgloss.Style
CursorFold lipgloss.Style
HlDelete lipgloss.Style
HlInsert lipgloss.Style
HlUpdate lipgloss.Style
HlMove lipgloss.Style
HlMoveUpdate lipgloss.Style
HoverCard lipgloss.Style
HoverDetail lipgloss.Style
HoverDim lipgloss.Style
GitHeader lipgloss.Style
GitCursor lipgloss.Style
GitNormal lipgloss.Style
CommitPanel lipgloss.Style
HelpCard lipgloss.Style
HelpTitle lipgloss.Style
HelpSectionHeader lipgloss.Style
}
Styles contains precomputed lipgloss styles for efficient rendering.
type Theme ¶
type Theme struct {
Name string
IsDark bool
UI UIColors
Actions ActionColors
Styles Styles
// contains filtered or unexported fields
}
Theme encapsulates UI palette, Action palette, Tree-sitter capture map, and UI styles.
func BuildCustomTheme ¶
func BuildCustomTheme(tc config.ThemeConfig) *Theme
BuildCustomTheme builds a Theme from a ThemeConfig, filling in any unconfigured colors from Mocha (dark) or Latte (light).
func CatppuccinLatteTheme ¶
func CatppuccinLatteTheme() *Theme
CatppuccinLatteTheme returns the light Catppuccin Latte theme.
func CatppuccinMochaTheme ¶
func CatppuccinMochaTheme() *Theme
CatppuccinMochaTheme returns the dark Catppuccin Mocha theme.
func ResolveThemeWithConfig ¶
func ResolveThemeWithConfig(name string, style string, customThemes map[string]config.ThemeConfig) (*Theme, error)
ResolveThemeWithConfig finds a theme by name, applying the style preference and any custom config themes.
func (*Theme) ActionFg ¶
func (t *Theme) ActionFg(kind ActionKind) lipgloss.Color
ActionFg returns the foreground color for an action kind.
func (*Theme) ActionIcon ¶
func (t *Theme) ActionIcon(kind ActionKind) string
ActionIcon returns the icon for an action kind.
func (*Theme) CaptureColor ¶
CaptureColor maps Tree-sitter capture names to theme foreground colors. It falls back to parent categories (e.g. "function.method" matches "function").
type UIColors ¶
type UIColors struct {
Base lipgloss.Color
Mantle lipgloss.Color
Crust lipgloss.Color
Surface0 lipgloss.Color
Surface1 lipgloss.Color
Surface2 lipgloss.Color
Overlay0 lipgloss.Color
Overlay1 lipgloss.Color
Overlay2 lipgloss.Color
Subtext0 lipgloss.Color
Subtext1 lipgloss.Color
Text lipgloss.Color
Lavender lipgloss.Color
Mauve lipgloss.Color
Blue lipgloss.Color
Green lipgloss.Color
Peach lipgloss.Color
Sky lipgloss.Color
Yellow lipgloss.Color
Pink lipgloss.Color
Red lipgloss.Color
Teal lipgloss.Color
Rosewater lipgloss.Color
Sapphire lipgloss.Color
Maroon lipgloss.Color
Flamingo lipgloss.Color
}
UIColors contains the standard UI chrome palette.