theme

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
	HelpFooter        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

func (t *Theme) CaptureColor(capture string) lipgloss.Color

CaptureColor maps Tree-sitter capture names to theme foreground colors. It falls back to parent categories (e.g. "function.method" matches "function").

func (*Theme) HlStyle

func (t *Theme) HlStyle(kind ActionKind) lipgloss.Style

HlStyle returns the highlight style for an action kind.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL