Documentation
¶
Index ¶
- Constants
- func Available() []string
- func AvailableDisplayNames() map[string]string
- func ContextWithPalette(ctx context.Context, p Palette) context.Context
- func CurrentName() string
- func DetectDefaultName() string
- func Exists(name string) bool
- func IsConfiguredExplicitly() bool
- func SetConfiguredExplicitly(v bool)
- func SetCurrent(name string) error
- type Color
- type Flag
- type Palette
- type Token
Constants ¶
const AutoName = "auto"
AutoName selects a built-in Kong theme based on the terminal background.
const DarkName = "kong-dark"
DarkName is the built-in Kong theme optimized for dark terminal backgrounds.
const DefaultName = "kong-light"
DefaultName is the built-in Kong theme optimized for light terminal backgrounds.
const LegacyName = "kong"
LegacyName is the deprecated theme name kept for backward compatibility.
Variables ¶
This section is empty.
Functions ¶
func Available ¶
func Available() []string
Available returns the list of registered theme IDs (sorted).
func AvailableDisplayNames ¶
AvailableDisplayNames returns a map of theme IDs to display names.
func ContextWithPalette ¶
ContextWithPalette stores the palette on the context.
func DetectDefaultName ¶ added in v1.0.0
func DetectDefaultName() string
DetectDefaultName returns the built-in Kong theme that best matches the detected terminal background.
func IsConfiguredExplicitly ¶ added in v0.5.0
func IsConfiguredExplicitly() bool
IsConfiguredExplicitly reports whether the user has explicitly chosen a theme.
func SetConfiguredExplicitly ¶ added in v0.5.0
func SetConfiguredExplicitly(v bool)
SetConfiguredExplicitly records whether the active theme was set by the user (via config file, environment variable, or flag) rather than falling back to the built-in default.
Types ¶
type Flag ¶
type Flag struct {
// contains filtered or unexported fields
}
Flag is a pflag.Value implementation for theme IDs.
type Palette ¶
Palette represents a concrete theme.
func FromContext ¶
FromContext returns the palette stored on the context or the current palette.
func (Palette) BackgroundStyle ¶
BackgroundStyle returns a lipgloss style with the background set to the requested token.
type Token ¶
type Token string
Token represents a semantic color slot within the CLI.
const ( ColorTextPrimary Token = "text.primary" ColorTextSecondary Token = "text.secondary" ColorTextMuted Token = "text.muted" ColorBorder Token = "border" ColorSurface Token = "surface" ColorSurfaceText Token = "surface.text" ColorPrimary Token = "primary" ColorPrimaryText Token = "primary.text" ColorAccent Token = "accent" ColorAccentText Token = "accent.text" ColorSelection Token = "selection" ColorSelectionText Token = "selection.text" ColorSuccess Token = "success" ColorSuccessText Token = "success.text" ColorInfo Token = "info" ColorInfoText Token = "info.text" ColorWarning Token = "warning" ColorWarningText Token = "warning.text" ColorDanger Token = "danger" ColorDangerText Token = "danger.text" ColorHighlight Token = "highlight" )