Files
career-ops-vbleroy/dashboard/internal/theme/theme.go
T
redlineo d295c7f139
Release Please / release-please (push) Failing after 4m2s
Web CI / web typecheck + build (push) Successful in 3m39s
CodeQL Analysis / Analyze (javascript-typescript) (push) Failing after 1h1m49s
CodeQL Analysis / Analyze (go) (push) Failing after 1h1m49s
init
2026-07-13 10:14:00 +03: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()
}
}