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

Function ApplyCustomTheme

internal/ui/theme/theme.go:562–622  ·  view source on GitHub ↗

ApplyCustomTheme applies the resolved theme to the Colors struct. Users can select a built-in theme by name and override any color.

(cfg *config.ThemeConfig)

Source from the content-addressed store, hash-verified

560// ApplyCustomTheme applies the resolved theme to the Colors struct.
561// Users can select a built-in theme by name and override any color.
562func ApplyCustomTheme(cfg *config.ThemeConfig) {
563 resolved := ResolveTheme(cfg)
564 for key, val := range resolved {
565 c := parseColor(val)
566
567 switch key {
568 case "primary":
569 Colors.Primary = c
570 case "secondary":
571 Colors.Secondary = c
572 case "tertiary":
573 Colors.Tertiary = c
574 case "success":
575 Colors.Success = c
576 case "warning":
577 Colors.Warning = c
578 case "error":
579 Colors.Error = c
580 case "info":
581 Colors.Info = c
582 case "background":
583 Colors.Background = c
584 case "border":
585 Colors.Border = c
586 case "selection":
587 Colors.Selection = c
588 case "header":
589 Colors.Header = c
590 case "headertext":
591 Colors.HeaderText = c
592 case "footer":
593 Colors.Footer = c
594 case "footertext":
595 Colors.FooterText = c
596 case "title":
597 Colors.Title = c
598 case "contrast":
599 Colors.Contrast = c
600 case "morecontrast":
601 Colors.MoreContrast = c
602 case "inverse":
603 Colors.Inverse = c
604 case "statusrunning":
605 Colors.StatusRunning = c
606 case "statusstopped":
607 Colors.StatusStopped = c
608 case "statuspending":
609 Colors.StatusPending = c
610 case "statuserror":
611 Colors.StatusError = c
612 case "usagelow":
613 Colors.UsageLow = c
614 case "usagemedium":
615 Colors.UsageMedium = c
616 case "usagehigh":
617 Colors.UsageHigh = c
618 case "usagecritical":
619 Colors.UsageCritical = c

Callers 2

LaunchConfigWizardFunction · 0.92
StartApplicationFunction · 0.92

Calls 2

ResolveThemeFunction · 0.85
parseColorFunction · 0.85

Tested by

no test coverage detected