Documentation
¶
Index ¶
- Constants
- func Available() []string
- func AvailableDisplayNames() map[string]string
- func ContextWithPalette(ctx context.Context, p Palette) context.Context
- func CurrentName() 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 DefaultName = "kong-light"
DefaultName is the built-in theme used when no override is provided.
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 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 Color ¶
Color stores light and dark variants for adaptive rendering.
func (Color) Adaptive ¶
func (c Color) Adaptive() lipgloss.AdaptiveColor
Adaptive converts the color into a lipgloss adaptive color.
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) Adaptive ¶
func (p Palette) Adaptive(token Token) lipgloss.AdaptiveColor
Adaptive returns the lipgloss adaptive color for the provided token.
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" 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" )