MCPcopy
hub / github.com/docker/docker-agent / LoadTheme

Function LoadTheme

pkg/tui/styles/theme.go:561–563  ·  view source on GitHub ↗

LoadTheme loads a theme by reference with mtime-aware caching. If ref is "" (empty), this is an error - caller should resolve to DefaultThemeRef first. Refs starting with "user:" (e.g., "user:nord") explicitly load from user themes directory. Other refs load built-in themes first, falling back to u

(ref string)

Source from the content-addressed store, hash-verified

559// The cache is mtime-aware: user themes are re-parsed only when the file's modTime changes.
560// If a user theme file exists but fails to parse, an error is returned (no silent fallback).
561func LoadTheme(ref string) (*Theme, error) {
562 return defaultRegistry.Load().LoadTheme(ref)
563}
564
565func (r *themeRegistry) LoadTheme(ref string) (*Theme, error) {
566 // Empty ref means "use default theme" - caller should resolve this to DefaultThemeRef

Callers 15

handleOpenThemePickerMethod · 0.92
handleChangeThemeMethod · 0.92
handleThemePreviewMethod · 0.92
validateThemeFunction · 0.92
applyThemeFunction · 0.92
TestLoadTheme_DefaultFunction · 0.85
ApplyThemeRefFunction · 0.85

Calls 2

LoadThemeMethod · 0.80
LoadMethod · 0.80