theme

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package theme provides terminal theming with automatic detection. It supports reading colors from Alacritty, Kitty, Foot, and Omarchy terminal configurations, with environment variable overrides available.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MixColors

func MixColors(hex1, hex2 string, t float64) string

MixColors blends two colors together

func Refresh

func Refresh()

Refresh reloads the theme from config files

Types

type AlacrittyConfig

type AlacrittyConfig struct {
	Colors struct {
		Primary struct {
			Background string `toml:"background"`
			Foreground string `toml:"foreground"`
		} `toml:"primary"`
		Selection struct {
			Background string `toml:"background"`
			Text       string `toml:"text"`
		} `toml:"selection"`
		Cursor struct {
			Cursor string `toml:"cursor"`
		} `toml:"cursor"`
	} `toml:"colors"`
}

AlacrittyConfig represents the relevant parts of alacritty.toml

type Palette

type Palette struct {
	BG       string // background
	FG       string // foreground (primary text)
	Muted    string // timestamps, secondary info
	Accent   string // health bars, highlights
	AccentBg string // selection background
	Error    string // error/warning colors
}

Palette holds the color scheme for the TUI

var CurrentPalette Palette

func DefaultPalette

func DefaultPalette() Palette

DefaultPalette returns the fallback amber-on-dark theme

func Detect

func Detect() Palette

Detect attempts to load theme from various sources in priority order

type Styles

type Styles struct {
	App           lipgloss.Style
	Header        lipgloss.Style
	Title         lipgloss.Style
	StatusBar     lipgloss.Style
	SearchInput   lipgloss.Style
	SearchPrompt  lipgloss.Style
	Table         lipgloss.Style
	TableHeader   lipgloss.Style
	SortedHeader  lipgloss.Style // Highlighted sorted column
	TableRow      lipgloss.Style
	TableSelected lipgloss.Style
	HealthGood    lipgloss.Style
	HealthMed     lipgloss.Style
	HealthBad     lipgloss.Style
	Muted         lipgloss.Style
	Error         lipgloss.Style
	VPNConnected  lipgloss.Style
	VPNDisconnect lipgloss.Style
	HelpKey       lipgloss.Style
	HelpDesc      lipgloss.Style
	Panel         lipgloss.Style
	PanelTitle    lipgloss.Style
}

Styles holds all lipgloss styles derived from a palette

var Current Styles

Current holds the active palette and styles

func NewStyles

func NewStyles(p Palette) Styles

NewStyles creates styles from a palette

type Watcher

type Watcher struct {
	// contains filtered or unexported fields
}

Watcher monitors theme config files and triggers refresh on changes

func NewWatcher

func NewWatcher(onChange func()) (*Watcher, error)

NewWatcher creates a file watcher for theme configs

func (*Watcher) Stop

func (w *Watcher) Stop()

Stop closes the watcher

Jump to

Keyboard shortcuts

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