theme

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultThemeYAML = `` /* 1443-byte string literal not displayed */

DefaultThemeYAML is the initial theme created at <client app dir>/theme.yaml.

Palettes: - default: neutral base - primary/secondary: accent colors - success/warning/danger: semantic colors

Each palette has a "default" value and a set of numeric modifiers: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900.

View Source
const (
	ThemeFileName = "theme.yaml"
)

Variables

This section is empty.

Functions

func Danger

func Danger() lipgloss.Color

Danger returns the theme danger color.

func DangerMod

func DangerMod(mod int) lipgloss.Color

func Default

func Default() lipgloss.Color

Default returns the theme default/neutral color.

func DefaultMod

func DefaultMod(mod int) lipgloss.Color

func EnsureThemeFile

func EnsureThemeFile() error

func HuhTheme

func HuhTheme() *huh.Theme

HuhTheme returns a huh Theme derived from the current Sliver client theme.

This is used for all interactive TUI forms in the client so that colors are consistent with the rest of the console styling (theme.yaml).

func LoadAndSetCurrentTheme

func LoadAndSetCurrentTheme() error

func Primary

func Primary() lipgloss.Color

Primary returns the theme primary color.

func PrimaryMod

func PrimaryMod(mod int) lipgloss.Color

func Secondary

func Secondary() lipgloss.Color

Secondary returns the theme secondary color.

func SecondaryMod

func SecondaryMod(mod int) lipgloss.Color

func SetCurrentTheme

func SetCurrentTheme(t Theme)

func Success

func Success() lipgloss.Color

Success returns the theme success color.

func SuccessMod

func SuccessMod(mod int) lipgloss.Color

func ThemePath

func ThemePath() string

func Warning

func Warning() lipgloss.Color

Warning returns the theme warning color.

func WarningMod

func WarningMod(mod int) lipgloss.Color

Types

type Palette

type Palette struct {
	Default string         `yaml:"default"`
	Mods    map[int]string `yaml:"mods"`
}

type Theme

type Theme struct {
	Primary   Palette `yaml:"primary"`
	Secondary Palette `yaml:"secondary"`
	Default   Palette `yaml:"default"`
	Success   Palette `yaml:"success"`
	Warning   Palette `yaml:"warning"`
	Danger    Palette `yaml:"danger"`
}

func Current

func Current() Theme

Current returns the in-memory current theme (defaults to DefaultThemeYAML).

func LoadThemeFromDisk

func LoadThemeFromDisk() (Theme, error)

Jump to

Keyboard shortcuts

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