Files
santifer--career-ops/dashboard/internal/theme/theme.go
T
wehub-resource-sync d083df1fdb
CodeQL Analysis / Analyze (javascript-typescript) (push) Failing after 2s
Web CI / web typecheck + build (push) Failing after 1s
Release Please / release-please (push) Failing after 1s
CodeQL Analysis / Analyze (go) (push) Failing after 16s
chore: import upstream snapshot with attribution
2026-07-13 12:02:43 +08:00

45 lines
1004 B
Go

// Package theme provides the visual theme system for the dashboard.
package theme
import (
"github.com/charmbracelet/lipgloss"
"github.com/muesli/termenv"
)
// Theme holds all color definitions for the pipeline dashboard.
type Theme struct {
// Base colors
Base lipgloss.Color
Surface lipgloss.Color
Overlay lipgloss.Color
Text lipgloss.Color
Subtext lipgloss.Color
// Accent colors
Blue lipgloss.Color
Mauve lipgloss.Color
Green lipgloss.Color
Yellow lipgloss.Color
Sky lipgloss.Color
Peach lipgloss.Color
Red lipgloss.Color
Pink lipgloss.Color
}
// NewTheme creates a theme by name. Use "auto" or "" to detect from terminal background.
func NewTheme(name string) Theme {
switch name {
case "catppuccin-mocha":
return newCatppuccinMocha()
case "catppuccin-latte":
return newCatppuccinLatte()
case "auto", "":
if termenv.HasDarkBackground() {
return newCatppuccinMocha()
}
return newCatppuccinLatte()
default:
return newCatppuccinMocha()
}
}