theme

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package theme defines the lipgloss styles used across the UI. All colors live here; views and components never hardcode colors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccentColor

func AccentColor(name string) (color.Color, bool)

AccentColor returns the color for a named accent (case-insensitive), or false if name is not a known accent.

func AccentNames

func AccentNames() []string

AccentNames returns the accent color names in a stable order — the choices offered by the color picker.

func Contrast

func Contrast(bg color.Color) color.Color

Contrast returns a foreground color (black or white) that stays legible when drawn on top of bg, chosen by perceived luminance. Used for the header's highlight chip so the profile name reads on any accent (e.g. dark on yellow, light on red).

func HighlightColor

func HighlightColor(profile string, skins map[string]string) (color.Color, bool)

HighlightColor resolves the highlight color a user configured for a profile via skins globs (e.g. "PROD-*": red). It returns false when no glob matches or the mapped name is not a known color — a typo just leaves the profile with the default (uncoloured) treatment rather than breaking rendering.

Types

type Theme

type Theme struct {
	// Accent is the app-wide highlight color.
	Accent color.Color

	Title    lipgloss.Style
	Subtle   lipgloss.Style
	Error    lipgloss.Style
	Success  lipgloss.Style
	Warning  lipgloss.Style
	KeyHint  lipgloss.Style
	KeyLabel lipgloss.Style
}

Theme is the set of styles the app renders with. The accent is app-wide and constant; per-profile highlighting (see skins.go) colors only the header name/host, leaving the rest of the UI on the default accent.

func Default

func Default() Theme

Default returns the built-in skin.

Jump to

Keyboard shortcuts

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