theme

package
v1.16.2-0...-82d92f0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Colors

func Colors(p Palette) map[string]color.Color

Colors exposes palette colors in case external packages require image/color.

func GetAvailableThemes

func GetAvailableThemes() []string

GetAvailableThemes returns all available preset theme names

func Names

func Names() []string

Names returns sorted preset names.

Types

type Palette

type Palette struct {
	// Accents and roles
	Accent  color.Color // primary accent (selection/background)
	Warning color.Color // headings, hints
	Dim     color.Color // subtle text

	// Status colors
	Success  color.Color // Healthy/Synced
	Danger   color.Color // OutOfSync/Degraded
	Progress color.Color // Progressing
	Unknown  color.Color // Unknown/neutral

	// Additional accents
	Info color.Color // cyan accents
	Text color.Color // bright white text
	Gray color.Color // gray

	// Specific backgrounds
	SelectedBG       color.Color // selected row bg (usually == Accent)
	CursorSelectedBG color.Color // cursor on selected row bg
	CursorBG         color.Color // cursor on unselected row bg
	Border           color.Color // border color

	// Neutrals/backgrounds
	MutedBG color.Color // low-contrast background (e.g., inactive buttons)
	ShadeBG color.Color // subtle row highlight background
	DarkBG  color.Color // dark panel background when needed
}

Palette defines the core colors used by the TUI. It uses lipgloss.TerminalColor so themes can be ANSI indices, truecolor hex values, or AdaptiveColor depending on the terminal.

func Default

func Default() Palette

Default returns the stock palette matching the previous hardcoded colors. This is kept for backward compatibility and as a fallback.

func FromConfig

func FromConfig(cfg *config.ArgonautConfig) Palette

FromConfig creates a palette from the Argonaut configuration. It handles built-in presets, custom themes, and overrides.

func FromName

func FromName(name string) Palette

FromName returns a preset by name, or the default theme (oxocarbon) if unknown.

func Get

func Get(name string) (Palette, bool)

Get returns a preset and whether it exists.

func NewPalette

func NewPalette(
	accent, warning, dim color.Color,
	success, danger, progress, unknown color.Color,
	info, text, gray color.Color,
	selectedBG, cursorSelectedBG, cursorBG, border color.Color,
	mutedBG, shadeBG, darkBG color.Color,
) Palette

NewPalette creates a new palette with all required colors. This function enforces that all color fields are provided at compile time.

Jump to

Keyboard shortcuts

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