MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / ResolveTheme

Function ResolveTheme

internal/ui/theme/theme.go:537–558  ·  view source on GitHub ↗

ResolveTheme merges the selected built-in theme with user overrides.

(cfg *config.ThemeConfig)

Source from the content-addressed store, hash-verified

535
536// ResolveTheme merges the selected built-in theme with user overrides.
537func ResolveTheme(cfg *config.ThemeConfig) map[string]string {
538 base := BuiltInThemes["default"]
539
540 if cfg != nil && cfg.Name != "" {
541 if t, ok := BuiltInThemes[cfg.Name]; ok {
542 base = t
543 }
544 }
545 // Copy base to avoid mutation
546 resolved := make(map[string]string)
547 for k, v := range base {
548 resolved[k] = v
549 }
550
551 if cfg != nil {
552 for k, v := range cfg.Colors {
553 resolved[k] = v
554 }
555 }
556
557 return resolved
558}
559
560// ApplyCustomTheme applies the resolved theme to the Colors struct.
561// Users can select a built-in theme by name and override any color.

Callers 1

ApplyCustomThemeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected