From e35920969927ef292c2cf73feddf19456dab8feb Mon Sep 17 00:00:00 2001 From: Kujtim Hoxha Date: Wed, 4 Jun 2025 13:18:36 +0200 Subject: [PATCH] remove old theme --- internal/app/app.go | 20 -- internal/tui/components/dialog/permission.go | 6 +- internal/tui/components/dialogs/quit/quit.go | 8 +- internal/tui/components/logs/details.go | 28 +-- internal/tui/components/logs/table.go | 6 +- internal/tui/theme/catppuccin.go | 172 -------------- internal/tui/theme/dracula.go | 106 --------- internal/tui/theme/flexoki.go | 204 ----------------- internal/tui/theme/gruvbox.go | 224 ------------------- internal/tui/theme/manager.go | 124 ---------- internal/tui/theme/monokai.go | 195 ---------------- internal/tui/theme/onedark.go | 196 ---------------- internal/tui/theme/opencode.go | 199 ---------------- internal/tui/theme/theme.go | 205 ----------------- internal/tui/theme/theme_test.go | 89 -------- internal/tui/theme/tokyonight.go | 196 ---------------- internal/tui/theme/tron.go | 198 ---------------- 17 files changed, 24 insertions(+), 2152 deletions(-) delete mode 100644 internal/tui/theme/catppuccin.go delete mode 100644 internal/tui/theme/dracula.go delete mode 100644 internal/tui/theme/flexoki.go delete mode 100644 internal/tui/theme/gruvbox.go delete mode 100644 internal/tui/theme/manager.go delete mode 100644 internal/tui/theme/monokai.go delete mode 100644 internal/tui/theme/onedark.go delete mode 100644 internal/tui/theme/opencode.go delete mode 100644 internal/tui/theme/theme.go delete mode 100644 internal/tui/theme/theme_test.go delete mode 100644 internal/tui/theme/tokyonight.go delete mode 100644 internal/tui/theme/tron.go diff --git a/internal/app/app.go b/internal/app/app.go index abdc1431db585694021b66df6490c3f50e41bd64..9ebb00ea9bfe6823ec6f02bfd1f6111f6ec58adf 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -19,7 +19,6 @@ import ( "github.com/opencode-ai/opencode/internal/message" "github.com/opencode-ai/opencode/internal/permission" "github.com/opencode-ai/opencode/internal/session" - "github.com/opencode-ai/opencode/internal/tui/theme" ) type App struct { @@ -53,9 +52,6 @@ func New(ctx context.Context, conn *sql.DB) (*App, error) { LSPClients: make(map[string]*lsp.Client), } - // Initialize theme based on configuration - app.initTheme() - // Initialize LSP clients in the background go app.initLSPClients(ctx) @@ -80,22 +76,6 @@ func New(ctx context.Context, conn *sql.DB) (*App, error) { return app, nil } -// initTheme sets the application theme based on the configuration -func (app *App) initTheme() { - cfg := config.Get() - if cfg == nil || cfg.TUI.Theme == "" { - return // Use default theme - } - - // Try to set the theme from config - err := theme.SetTheme(cfg.TUI.Theme) - if err != nil { - logging.Warn("Failed to set theme from config, using default theme", "theme", cfg.TUI.Theme, "error", err) - } else { - logging.Debug("Set theme from config", "theme", cfg.TUI.Theme) - } -} - // RunNonInteractive handles the execution flow when a prompt is provided via CLI flag. func (a *App) RunNonInteractive(ctx context.Context, prompt string, outputFormat string, quiet bool) error { logging.Info("Running in non-interactive mode") diff --git a/internal/tui/components/dialog/permission.go b/internal/tui/components/dialog/permission.go index 33332e44eaae9de25653f328ad9de457a121c48a..241dcca1ad3bbd52c97d2ba8306cb32a398a003a 100644 --- a/internal/tui/components/dialog/permission.go +++ b/internal/tui/components/dialog/permission.go @@ -157,17 +157,17 @@ func (p *permissionDialogCmp) renderButtons() string { // Style the selected button switch p.selectedOption { case 0: - allowStyle = allowStyle.Background(t.Primary) + allowStyle = allowStyle.Background(t.Secondary) allowSessionStyle = allowSessionStyle.Background(t.BgSubtle) denyStyle = denyStyle.Background(t.BgSubtle) case 1: allowStyle = allowStyle.Background(t.BgSubtle) - allowSessionStyle = allowSessionStyle.Background(t.Primary) + allowSessionStyle = allowSessionStyle.Background(t.Secondary) denyStyle = denyStyle.Background(t.BgSubtle) case 2: allowStyle = allowStyle.Background(t.BgSubtle) allowSessionStyle = allowSessionStyle.Background(t.BgSubtle) - denyStyle = denyStyle.Background(t.Primary) + denyStyle = denyStyle.Background(t.Secondary) } allowButton := allowStyle.Padding(0, 1).Render("Allow (a)") diff --git a/internal/tui/components/dialogs/quit/quit.go b/internal/tui/components/dialogs/quit/quit.go index 987edbd6874c29a58c442a238258a0ea68f90360..df0dbf8887bbbb8d512de4dc911448e695ff62d8 100644 --- a/internal/tui/components/dialogs/quit/quit.go +++ b/internal/tui/components/dialogs/quit/quit.go @@ -74,15 +74,15 @@ func (q *quitDialogCmp) View() tea.View { noStyle := yesStyle if q.selectedNo { - noStyle = noStyle.Background(t.Primary) + noStyle = noStyle.Background(t.Secondary) yesStyle = yesStyle.Background(t.BgSubtle) } else { - yesStyle = yesStyle.Background(t.Primary) + yesStyle = yesStyle.Background(t.Secondary) noStyle = noStyle.Background(t.BgSubtle) } - yesButton := yesStyle.Padding(0, 1).Render("Yes") - noButton := noStyle.Padding(0, 1).Render("No") + yesButton := yesStyle.Padding(0, 1).Render("Yep!") + noButton := noStyle.Padding(0, 1).Render("Nope") buttons := baseStyle.Width(lipgloss.Width(question)).Align(lipgloss.Right).Render( lipgloss.JoinHorizontal(lipgloss.Center, yesButton, " ", noButton), diff --git a/internal/tui/components/logs/details.go b/internal/tui/components/logs/details.go index 9ee743ca680eab852fb30a059983bbc5f5427f2c..09ddef9c0421a73d5c6a491e8897ea4cda673982 100644 --- a/internal/tui/components/logs/details.go +++ b/internal/tui/components/logs/details.go @@ -11,7 +11,7 @@ import ( "github.com/charmbracelet/lipgloss/v2" "github.com/opencode-ai/opencode/internal/logging" "github.com/opencode-ai/opencode/internal/tui/layout" - "github.com/opencode-ai/opencode/internal/tui/theme" + "github.com/opencode-ai/opencode/internal/tui/styles" "github.com/opencode-ai/opencode/internal/tui/util" ) @@ -50,10 +50,10 @@ func (i *detailCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) { func (i *detailCmp) updateContent() { var content strings.Builder - t := theme.CurrentTheme() + t := styles.CurrentTheme() // Format the header with timestamp and level - timeStyle := lipgloss.NewStyle().Foreground(t.TextMuted()) + timeStyle := t.S().Muted levelStyle := getLevelStyle(i.currentLog.Level) header := lipgloss.JoinHorizontal( @@ -67,7 +67,7 @@ func (i *detailCmp) updateContent() { content.WriteString("\n\n") // Message with styling - messageStyle := lipgloss.NewStyle().Bold(true).Foreground(t.Text()) + messageStyle := t.S().Text.Bold(true) content.WriteString(messageStyle.Render("Message:")) content.WriteString("\n") content.WriteString(lipgloss.NewStyle().Padding(0, 2).Render(i.currentLog.Message)) @@ -75,13 +75,13 @@ func (i *detailCmp) updateContent() { // Attributes section if len(i.currentLog.Attributes) > 0 { - attrHeaderStyle := lipgloss.NewStyle().Bold(true).Foreground(t.Text()) + attrHeaderStyle := t.S().Text.Bold(true) content.WriteString(attrHeaderStyle.Render("Attributes:")) content.WriteString("\n") // Create a table-like display for attributes - keyStyle := lipgloss.NewStyle().Foreground(t.Primary()).Bold(true) - valueStyle := lipgloss.NewStyle().Foreground(t.Text()) + keyStyle := t.S().Base.Foreground(t.Primary).Bold(true) + valueStyle := t.S().Text for _, attr := range i.currentLog.Attributes { attrLine := fmt.Sprintf("%s: %s", @@ -97,20 +97,20 @@ func (i *detailCmp) updateContent() { } func getLevelStyle(level string) lipgloss.Style { - style := lipgloss.NewStyle().Bold(true) - t := theme.CurrentTheme() + t := styles.CurrentTheme() + style := t.S().Base.Bold(true) switch strings.ToLower(level) { case "info": - return style.Foreground(t.Info()) + return style.Foreground(t.Info) case "warn", "warning": - return style.Foreground(t.Warning()) + return style.Foreground(t.Warning) case "error", "err": - return style.Foreground(t.Error()) + return style.Foreground(t.Error) case "debug": - return style.Foreground(t.Success()) + return style.Foreground(t.Success) default: - return style.Foreground(t.Text()) + return style.Foreground(t.FgBase) } } diff --git a/internal/tui/components/logs/table.go b/internal/tui/components/logs/table.go index 791d104bc0e7127136420bcd2519815709f5b79f..b36d2d967c01c2bb8c23d23de7049768fea9cb47 100644 --- a/internal/tui/components/logs/table.go +++ b/internal/tui/components/logs/table.go @@ -10,7 +10,7 @@ import ( "github.com/opencode-ai/opencode/internal/logging" "github.com/opencode-ai/opencode/internal/pubsub" "github.com/opencode-ai/opencode/internal/tui/layout" - "github.com/opencode-ai/opencode/internal/tui/theme" + "github.com/opencode-ai/opencode/internal/tui/styles" "github.com/opencode-ai/opencode/internal/tui/util" ) @@ -61,9 +61,9 @@ func (i *tableCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } func (i *tableCmp) View() tea.View { - t := theme.CurrentTheme() + t := styles.CurrentTheme() defaultStyles := table.DefaultStyles() - defaultStyles.Selected = defaultStyles.Selected.Foreground(t.Primary()) + defaultStyles.Selected = defaultStyles.Selected.Foreground(t.Primary) i.table.SetStyles(defaultStyles) return tea.NewView(i.table.View()) } diff --git a/internal/tui/theme/catppuccin.go b/internal/tui/theme/catppuccin.go deleted file mode 100644 index fd4df0657f82538b57a8eabcb73553df9f9ce9e1..0000000000000000000000000000000000000000 --- a/internal/tui/theme/catppuccin.go +++ /dev/null @@ -1,172 +0,0 @@ -package theme - -import ( - catppuccin "github.com/catppuccin/go" - "github.com/charmbracelet/lipgloss/v2" -) - -// CatppuccinTheme implements the Theme interface with Catppuccin colors. -// It provides both dark (Mocha) and light (Latte) variants. -type CatppuccinTheme struct { - BaseTheme -} - -// NewCatppuccinMochaTheme creates a new instance of the Catppuccin Mocha theme. -func NewCatppuccinMochaTheme() *CatppuccinTheme { - // Get the Catppuccin palette - mocha := catppuccin.Mocha - - theme := &CatppuccinTheme{} - - // Base colors - theme.PrimaryColor = lipgloss.Color(mocha.Blue().Hex) - theme.SecondaryColor = lipgloss.Color(mocha.Mauve().Hex) - theme.AccentColor = lipgloss.Color(mocha.Peach().Hex) - - // Status colors - theme.ErrorColor = lipgloss.Color(mocha.Red().Hex) - theme.WarningColor = lipgloss.Color(mocha.Peach().Hex) - theme.SuccessColor = lipgloss.Color(mocha.Green().Hex) - theme.InfoColor = lipgloss.Color(mocha.Blue().Hex) - - // Text colors - theme.TextColor = lipgloss.Color(mocha.Text().Hex) - theme.TextMutedColor = lipgloss.Color(mocha.Subtext0().Hex) - theme.TextEmphasizedColor = lipgloss.Color(mocha.Lavender().Hex) - - // Background colors - theme.BackgroundColor = lipgloss.Color("#212121") // From existing styles - theme.BackgroundSecondaryColor = lipgloss.Color("#2c2c2c") // From existing styles - theme.BackgroundDarkerColor = lipgloss.Color("#181818") // From existing styles - - // Border colors - theme.BorderNormalColor = lipgloss.Color("#4b4c5c") // From existing styles - theme.BorderFocusedColor = lipgloss.Color(mocha.Blue().Hex) - theme.BorderDimColor = lipgloss.Color(mocha.Surface0().Hex) - - // Diff view colors - theme.DiffAddedColor = lipgloss.Color("#478247") // From existing diff.go - theme.DiffRemovedColor = lipgloss.Color("#7C4444") // From existing diff.go - theme.DiffContextColor = lipgloss.Color("#a0a0a0") // From existing diff.go - theme.DiffHunkHeaderColor = lipgloss.Color("#a0a0a0") // From existing diff.go - theme.DiffHighlightAddedColor = lipgloss.Color("#DAFADA") // From existing diff.go - theme.DiffHighlightRemovedColor = lipgloss.Color("#FADADD") // From existing diff.go - theme.DiffAddedBgColor = lipgloss.Color("#303A30") // From existing diff.go - theme.DiffRemovedBgColor = lipgloss.Color("#3A3030") // From existing diff.go - theme.DiffContextBgColor = lipgloss.Color("#212121") // From existing diff.go - theme.DiffLineNumberColor = lipgloss.Color("#888888") // From existing diff.go - theme.DiffAddedLineNumberBgColor = lipgloss.Color("#293229") // From existing diff.go - theme.DiffRemovedLineNumberBgColor = lipgloss.Color("#332929") // From existing diff.go - - // Markdown colors - theme.MarkdownTextColor = lipgloss.Color(mocha.Text().Hex) - theme.MarkdownHeadingColor = lipgloss.Color(mocha.Mauve().Hex) - theme.MarkdownLinkColor = lipgloss.Color(mocha.Sky().Hex) - theme.MarkdownLinkTextColor = lipgloss.Color(mocha.Pink().Hex) - theme.MarkdownCodeColor = lipgloss.Color(mocha.Green().Hex) - theme.MarkdownBlockQuoteColor = lipgloss.Color(mocha.Yellow().Hex) - theme.MarkdownEmphColor = lipgloss.Color(mocha.Yellow().Hex) - theme.MarkdownStrongColor = lipgloss.Color(mocha.Peach().Hex) - theme.MarkdownHorizontalRuleColor = lipgloss.Color(mocha.Overlay0().Hex) - theme.MarkdownListItemColor = lipgloss.Color(mocha.Blue().Hex) - theme.MarkdownListEnumerationColor = lipgloss.Color(mocha.Sky().Hex) - theme.MarkdownImageColor = lipgloss.Color(mocha.Sapphire().Hex) - theme.MarkdownImageTextColor = lipgloss.Color(mocha.Pink().Hex) - theme.MarkdownCodeBlockColor = lipgloss.Color(mocha.Text().Hex) - - // Syntax highlighting colors - theme.SyntaxCommentColor = lipgloss.Color(mocha.Overlay1().Hex) - theme.SyntaxKeywordColor = lipgloss.Color(mocha.Pink().Hex) - theme.SyntaxFunctionColor = lipgloss.Color(mocha.Green().Hex) - theme.SyntaxVariableColor = lipgloss.Color(mocha.Sky().Hex) - theme.SyntaxStringColor = lipgloss.Color(mocha.Yellow().Hex) - theme.SyntaxNumberColor = lipgloss.Color(mocha.Teal().Hex) - theme.SyntaxTypeColor = lipgloss.Color(mocha.Sky().Hex) - theme.SyntaxOperatorColor = lipgloss.Color(mocha.Pink().Hex) - theme.SyntaxPunctuationColor = lipgloss.Color(mocha.Text().Hex) - - return theme -} - -// NewCatppuccinLatteTheme creates a new instance of the Catppuccin Latte theme. -func NewCatppuccinLatteTheme() *CatppuccinTheme { - // Get the Catppuccin palette - latte := catppuccin.Latte - - theme := &CatppuccinTheme{} - - // Base colors - theme.PrimaryColor = lipgloss.Color(latte.Blue().Hex) - theme.SecondaryColor = lipgloss.Color(latte.Mauve().Hex) - theme.AccentColor = lipgloss.Color(latte.Peach().Hex) - - // Status colors - theme.ErrorColor = lipgloss.Color(latte.Red().Hex) - theme.WarningColor = lipgloss.Color(latte.Peach().Hex) - theme.SuccessColor = lipgloss.Color(latte.Green().Hex) - theme.InfoColor = lipgloss.Color(latte.Blue().Hex) - - // Text colors - theme.TextColor = lipgloss.Color(latte.Text().Hex) - theme.TextMutedColor = lipgloss.Color(latte.Subtext0().Hex) - theme.TextEmphasizedColor = lipgloss.Color(latte.Lavender().Hex) - - // Background colors - theme.BackgroundColor = lipgloss.Color("#EEEEEE") // Light equivalent - theme.BackgroundSecondaryColor = lipgloss.Color("#E0E0E0") // Light equivalent - theme.BackgroundDarkerColor = lipgloss.Color("#F5F5F5") // Light equivalent - - // Border colors - theme.BorderNormalColor = lipgloss.Color("#BDBDBD") // Light equivalent - theme.BorderFocusedColor = lipgloss.Color(latte.Blue().Hex) - theme.BorderDimColor = lipgloss.Color(latte.Surface0().Hex) - - // Diff view colors - theme.DiffAddedColor = lipgloss.Color("#2E7D32") // Light equivalent - theme.DiffRemovedColor = lipgloss.Color("#C62828") // Light equivalent - theme.DiffContextColor = lipgloss.Color("#757575") // Light equivalent - theme.DiffHunkHeaderColor = lipgloss.Color("#757575") // Light equivalent - theme.DiffHighlightAddedColor = lipgloss.Color("#A5D6A7") // Light equivalent - theme.DiffHighlightRemovedColor = lipgloss.Color("#EF9A9A") // Light equivalent - theme.DiffAddedBgColor = lipgloss.Color("#E8F5E9") // Light equivalent - theme.DiffRemovedBgColor = lipgloss.Color("#FFEBEE") // Light equivalent - theme.DiffContextBgColor = lipgloss.Color("#F5F5F5") // Light equivalent - theme.DiffLineNumberColor = lipgloss.Color("#9E9E9E") // Light equivalent - theme.DiffAddedLineNumberBgColor = lipgloss.Color("#C8E6C9") // Light equivalent - theme.DiffRemovedLineNumberBgColor = lipgloss.Color("#FFCDD2") // Light equivalent - - // Markdown colors - theme.MarkdownTextColor = lipgloss.Color(latte.Text().Hex) - theme.MarkdownHeadingColor = lipgloss.Color(latte.Mauve().Hex) - theme.MarkdownLinkColor = lipgloss.Color(latte.Sky().Hex) - theme.MarkdownLinkTextColor = lipgloss.Color(latte.Pink().Hex) - theme.MarkdownCodeColor = lipgloss.Color(latte.Green().Hex) - theme.MarkdownBlockQuoteColor = lipgloss.Color(latte.Yellow().Hex) - theme.MarkdownEmphColor = lipgloss.Color(latte.Yellow().Hex) - theme.MarkdownStrongColor = lipgloss.Color(latte.Peach().Hex) - theme.MarkdownHorizontalRuleColor = lipgloss.Color(latte.Overlay0().Hex) - theme.MarkdownListItemColor = lipgloss.Color(latte.Blue().Hex) - theme.MarkdownListEnumerationColor = lipgloss.Color(latte.Sky().Hex) - theme.MarkdownImageColor = lipgloss.Color(latte.Sapphire().Hex) - theme.MarkdownImageTextColor = lipgloss.Color(latte.Pink().Hex) - theme.MarkdownCodeBlockColor = lipgloss.Color(latte.Text().Hex) - - // Syntax highlighting colors - theme.SyntaxCommentColor = lipgloss.Color(latte.Overlay1().Hex) - theme.SyntaxKeywordColor = lipgloss.Color(latte.Pink().Hex) - theme.SyntaxFunctionColor = lipgloss.Color(latte.Green().Hex) - theme.SyntaxVariableColor = lipgloss.Color(latte.Sky().Hex) - theme.SyntaxStringColor = lipgloss.Color(latte.Yellow().Hex) - theme.SyntaxNumberColor = lipgloss.Color(latte.Teal().Hex) - theme.SyntaxTypeColor = lipgloss.Color(latte.Sky().Hex) - theme.SyntaxOperatorColor = lipgloss.Color(latte.Pink().Hex) - theme.SyntaxPunctuationColor = lipgloss.Color(latte.Text().Hex) - - return theme -} - -func init() { - // Register the Catppuccin themes with the theme manager - RegisterTheme("catppuccin-mocha", NewCatppuccinMochaTheme()) - RegisterTheme("catppuccin-latte", NewCatppuccinLatteTheme()) -} diff --git a/internal/tui/theme/dracula.go b/internal/tui/theme/dracula.go deleted file mode 100644 index 10a1a7216107bff40415e3f56b66f49d6840035f..0000000000000000000000000000000000000000 --- a/internal/tui/theme/dracula.go +++ /dev/null @@ -1,106 +0,0 @@ -package theme - -import ( - "github.com/charmbracelet/lipgloss/v2" -) - -// DraculaTheme implements the Theme interface with Dracula colors. -// It provides both dark and light variants, though Dracula is primarily a dark theme. -type DraculaTheme struct { - BaseTheme -} - -// NewDraculaTheme creates a new instance of the Dracula theme. -func NewDraculaTheme() *DraculaTheme { - // Dracula color palette - // Official colors from https://draculatheme.com/ - darkBackground := "#282a36" - darkCurrentLine := "#44475a" - darkSelection := "#44475a" - darkForeground := "#f8f8f2" - darkComment := "#6272a4" - darkCyan := "#8be9fd" - darkGreen := "#50fa7b" - darkOrange := "#ffb86c" - darkPink := "#ff79c6" - darkPurple := "#bd93f9" - darkRed := "#ff5555" - darkYellow := "#f1fa8c" - darkBorder := "#44475a" - - theme := &DraculaTheme{} - - // Base colors - theme.PrimaryColor = lipgloss.Color(darkPurple) - theme.SecondaryColor = lipgloss.Color(darkPink) - theme.AccentColor = lipgloss.Color(darkCyan) - - // Status colors - theme.ErrorColor = lipgloss.Color(darkRed) - theme.WarningColor = lipgloss.Color(darkOrange) - theme.SuccessColor = lipgloss.Color(darkGreen) - theme.InfoColor = lipgloss.Color(darkCyan) - - // Text colors - theme.TextColor = lipgloss.Color(darkForeground) - theme.TextMutedColor = lipgloss.Color(darkComment) - theme.TextEmphasizedColor = lipgloss.Color(darkYellow) - - // Background colors - theme.BackgroundColor = lipgloss.Color(darkBackground) - theme.BackgroundSecondaryColor = lipgloss.Color(darkCurrentLine) - theme.BackgroundDarkerColor = lipgloss.Color("#21222c") // Slightly darker than background - - // Border colors - theme.BorderNormalColor = lipgloss.Color(darkBorder) - theme.BorderFocusedColor = lipgloss.Color(darkPurple) - theme.BorderDimColor = lipgloss.Color(darkSelection) - - // Diff view colors - theme.DiffAddedColor = lipgloss.Color(darkGreen) - theme.DiffRemovedColor = lipgloss.Color(darkRed) - theme.DiffContextColor = lipgloss.Color(darkComment) - theme.DiffHunkHeaderColor = lipgloss.Color(darkPurple) - theme.DiffHighlightAddedColor = lipgloss.Color("#50fa7b") - theme.DiffHighlightRemovedColor = lipgloss.Color("#ff5555") - theme.DiffAddedBgColor = lipgloss.Color("#2c3b2c") - theme.DiffRemovedBgColor = lipgloss.Color("#3b2c2c") - theme.DiffContextBgColor = lipgloss.Color(darkBackground) - theme.DiffLineNumberColor = lipgloss.Color(darkComment) - theme.DiffAddedLineNumberBgColor = lipgloss.Color("#253025") - theme.DiffRemovedLineNumberBgColor = lipgloss.Color("#302525") - - // Markdown colors - theme.MarkdownTextColor = lipgloss.Color(darkForeground) - theme.MarkdownHeadingColor = lipgloss.Color(darkPink) - theme.MarkdownLinkColor = lipgloss.Color(darkPurple) - theme.MarkdownLinkTextColor = lipgloss.Color(darkCyan) - theme.MarkdownCodeColor = lipgloss.Color(darkGreen) - theme.MarkdownBlockQuoteColor = lipgloss.Color(darkYellow) - theme.MarkdownEmphColor = lipgloss.Color(darkYellow) - theme.MarkdownStrongColor = lipgloss.Color(darkOrange) - theme.MarkdownHorizontalRuleColor = lipgloss.Color(darkComment) - theme.MarkdownListItemColor = lipgloss.Color(darkPurple) - theme.MarkdownListEnumerationColor = lipgloss.Color(darkCyan) - theme.MarkdownImageColor = lipgloss.Color(darkPurple) - theme.MarkdownImageTextColor = lipgloss.Color(darkCyan) - theme.MarkdownCodeBlockColor = lipgloss.Color(darkForeground) - - // Syntax highlighting colors - theme.SyntaxCommentColor = lipgloss.Color(darkComment) - theme.SyntaxKeywordColor = lipgloss.Color(darkPink) - theme.SyntaxFunctionColor = lipgloss.Color(darkGreen) - theme.SyntaxVariableColor = lipgloss.Color(darkOrange) - theme.SyntaxStringColor = lipgloss.Color(darkYellow) - theme.SyntaxNumberColor = lipgloss.Color(darkPurple) - theme.SyntaxTypeColor = lipgloss.Color(darkCyan) - theme.SyntaxOperatorColor = lipgloss.Color(darkPink) - theme.SyntaxPunctuationColor = lipgloss.Color(darkForeground) - - return theme -} - -func init() { - // Register the Dracula theme with the theme manager - RegisterTheme("dracula", NewDraculaTheme()) -} diff --git a/internal/tui/theme/flexoki.go b/internal/tui/theme/flexoki.go deleted file mode 100644 index 183cd65d0de26e7a511dde5f18a98caf523a0941..0000000000000000000000000000000000000000 --- a/internal/tui/theme/flexoki.go +++ /dev/null @@ -1,204 +0,0 @@ -package theme - -import ( - "github.com/charmbracelet/lipgloss/v2" -) - -// Flexoki color palette constants -const ( - // Base colors - flexokiPaper = "#FFFCF0" // Paper (lightest) - flexokiBase50 = "#F2F0E5" // bg-2 (light) - flexokiBase100 = "#E6E4D9" // ui (light) - flexokiBase150 = "#DAD8CE" // ui-2 (light) - flexokiBase200 = "#CECDC3" // ui-3 (light) - flexokiBase300 = "#B7B5AC" // tx-3 (light) - flexokiBase500 = "#878580" // tx-2 (light) - flexokiBase600 = "#6F6E69" // tx (light) - flexokiBase700 = "#575653" // tx-3 (dark) - flexokiBase800 = "#403E3C" // ui-3 (dark) - flexokiBase850 = "#343331" // ui-2 (dark) - flexokiBase900 = "#282726" // ui (dark) - flexokiBase950 = "#1C1B1A" // bg-2 (dark) - flexokiBlack = "#100F0F" // bg (darkest) - - // Accent colors - Light theme (600) - flexokiRed600 = "#AF3029" - flexokiOrange600 = "#BC5215" - flexokiYellow600 = "#AD8301" - flexokiGreen600 = "#66800B" - flexokiCyan600 = "#24837B" - flexokiBlue600 = "#205EA6" - flexokiPurple600 = "#5E409D" - flexokiMagenta600 = "#A02F6F" - - // Accent colors - Dark theme (400) - flexokiRed400 = "#D14D41" - flexokiOrange400 = "#DA702C" - flexokiYellow400 = "#D0A215" - flexokiGreen400 = "#879A39" - flexokiCyan400 = "#3AA99F" - flexokiBlue400 = "#4385BE" - flexokiPurple400 = "#8B7EC8" - flexokiMagenta400 = "#CE5D97" -) - -// FlexokiTheme implements the Theme interface with Flexoki colors. -// It provides both dark and light variants. -type FlexokiTheme struct { - BaseTheme -} - -// NewFlexokiDarkTheme creates a new instance of the Flexoki Dark theme. -func NewFlexokiDarkTheme() *FlexokiTheme { - theme := &FlexokiTheme{} - - // Base colors - theme.PrimaryColor = lipgloss.Color(flexokiBlue400) - theme.SecondaryColor = lipgloss.Color(flexokiPurple400) - theme.AccentColor = lipgloss.Color(flexokiOrange400) - - // Status colors - theme.ErrorColor = lipgloss.Color(flexokiRed400) - theme.WarningColor = lipgloss.Color(flexokiYellow400) - theme.SuccessColor = lipgloss.Color(flexokiGreen400) - theme.InfoColor = lipgloss.Color(flexokiCyan400) - - // Text colors - theme.TextColor = lipgloss.Color(flexokiBase300) - theme.TextMutedColor = lipgloss.Color(flexokiBase700) - theme.TextEmphasizedColor = lipgloss.Color(flexokiYellow400) - - // Background colors - theme.BackgroundColor = lipgloss.Color(flexokiBlack) - theme.BackgroundSecondaryColor = lipgloss.Color(flexokiBase950) - theme.BackgroundDarkerColor = lipgloss.Color(flexokiBase900) - - // Border colors - theme.BorderNormalColor = lipgloss.Color(flexokiBase900) - theme.BorderFocusedColor = lipgloss.Color(flexokiBlue400) - theme.BorderDimColor = lipgloss.Color(flexokiBase850) - - // Diff view colors - theme.DiffAddedColor = lipgloss.Color(flexokiGreen400) - theme.DiffRemovedColor = lipgloss.Color(flexokiRed400) - theme.DiffContextColor = lipgloss.Color(flexokiBase700) - theme.DiffHunkHeaderColor = lipgloss.Color(flexokiBase700) - theme.DiffHighlightAddedColor = lipgloss.Color(flexokiGreen400) - theme.DiffHighlightRemovedColor = lipgloss.Color(flexokiRed400) - theme.DiffAddedBgColor = lipgloss.Color("#1D2419") // Darker green background - theme.DiffRemovedBgColor = lipgloss.Color("#241919") // Darker red background - theme.DiffContextBgColor = lipgloss.Color(flexokiBlack) - theme.DiffLineNumberColor = lipgloss.Color(flexokiBase700) - theme.DiffAddedLineNumberBgColor = lipgloss.Color("#1A2017") // Slightly darker green - theme.DiffRemovedLineNumberBgColor = lipgloss.Color("#201717") // Slightly darker red - - // Markdown colors - theme.MarkdownTextColor = lipgloss.Color(flexokiBase300) - theme.MarkdownHeadingColor = lipgloss.Color(flexokiYellow400) - theme.MarkdownLinkColor = lipgloss.Color(flexokiCyan400) - theme.MarkdownLinkTextColor = lipgloss.Color(flexokiMagenta400) - theme.MarkdownCodeColor = lipgloss.Color(flexokiGreen400) - theme.MarkdownBlockQuoteColor = lipgloss.Color(flexokiCyan400) - theme.MarkdownEmphColor = lipgloss.Color(flexokiYellow400) - theme.MarkdownStrongColor = lipgloss.Color(flexokiOrange400) - theme.MarkdownHorizontalRuleColor = lipgloss.Color(flexokiBase800) - theme.MarkdownListItemColor = lipgloss.Color(flexokiBlue400) - theme.MarkdownListEnumerationColor = lipgloss.Color(flexokiBlue400) - theme.MarkdownImageColor = lipgloss.Color(flexokiPurple400) - theme.MarkdownImageTextColor = lipgloss.Color(flexokiMagenta400) - theme.MarkdownCodeBlockColor = lipgloss.Color(flexokiBase300) - - // Syntax highlighting colors (based on Flexoki's mappings) - theme.SyntaxCommentColor = lipgloss.Color(flexokiBase700) // tx-3 - theme.SyntaxKeywordColor = lipgloss.Color(flexokiGreen400) // gr - theme.SyntaxFunctionColor = lipgloss.Color(flexokiOrange400) // or - theme.SyntaxVariableColor = lipgloss.Color(flexokiBlue400) // bl - theme.SyntaxStringColor = lipgloss.Color(flexokiCyan400) // cy - theme.SyntaxNumberColor = lipgloss.Color(flexokiPurple400) // pu - theme.SyntaxTypeColor = lipgloss.Color(flexokiYellow400) // ye - theme.SyntaxOperatorColor = lipgloss.Color(flexokiBase500) // tx-2 - theme.SyntaxPunctuationColor = lipgloss.Color(flexokiBase500) // tx-2 - - return theme -} - -// NewFlexokiLightTheme creates a new instance of the Flexoki Light theme. -func NewFlexokiLightTheme() *FlexokiTheme { - theme := &FlexokiTheme{} - - // Base colors - theme.PrimaryColor = lipgloss.Color(flexokiBlue600) - theme.SecondaryColor = lipgloss.Color(flexokiPurple600) - theme.AccentColor = lipgloss.Color(flexokiOrange600) - - // Status colors - theme.ErrorColor = lipgloss.Color(flexokiRed600) - theme.WarningColor = lipgloss.Color(flexokiYellow600) - theme.SuccessColor = lipgloss.Color(flexokiGreen600) - theme.InfoColor = lipgloss.Color(flexokiCyan600) - - // Text colors - theme.TextColor = lipgloss.Color(flexokiBase600) - theme.TextMutedColor = lipgloss.Color(flexokiBase500) - theme.TextEmphasizedColor = lipgloss.Color(flexokiYellow600) - - // Background colors - theme.BackgroundColor = lipgloss.Color(flexokiPaper) - theme.BackgroundSecondaryColor = lipgloss.Color(flexokiBase50) - theme.BackgroundDarkerColor = lipgloss.Color(flexokiBase100) - - // Border colors - theme.BorderNormalColor = lipgloss.Color(flexokiBase100) - theme.BorderFocusedColor = lipgloss.Color(flexokiBlue600) - theme.BorderDimColor = lipgloss.Color(flexokiBase150) - - // Diff view colors - theme.DiffAddedColor = lipgloss.Color(flexokiGreen600) - theme.DiffRemovedColor = lipgloss.Color(flexokiRed600) - theme.DiffContextColor = lipgloss.Color(flexokiBase500) - theme.DiffHunkHeaderColor = lipgloss.Color(flexokiBase500) - theme.DiffHighlightAddedColor = lipgloss.Color(flexokiGreen600) - theme.DiffHighlightRemovedColor = lipgloss.Color(flexokiRed600) - theme.DiffAddedBgColor = lipgloss.Color("#EFF2E2") // Light green background - theme.DiffRemovedBgColor = lipgloss.Color("#F2E2E2") // Light red background - theme.DiffContextBgColor = lipgloss.Color(flexokiPaper) - theme.DiffLineNumberColor = lipgloss.Color(flexokiBase500) - theme.DiffAddedLineNumberBgColor = lipgloss.Color("#E5EBD9") // Light green - theme.DiffRemovedLineNumberBgColor = lipgloss.Color("#EBD9D9") // Light red - - // Markdown colors - theme.MarkdownTextColor = lipgloss.Color(flexokiBase600) - theme.MarkdownHeadingColor = lipgloss.Color(flexokiYellow600) - theme.MarkdownLinkColor = lipgloss.Color(flexokiCyan600) - theme.MarkdownLinkTextColor = lipgloss.Color(flexokiMagenta600) - theme.MarkdownCodeColor = lipgloss.Color(flexokiGreen600) - theme.MarkdownBlockQuoteColor = lipgloss.Color(flexokiCyan600) - theme.MarkdownEmphColor = lipgloss.Color(flexokiYellow600) - theme.MarkdownStrongColor = lipgloss.Color(flexokiOrange600) - theme.MarkdownHorizontalRuleColor = lipgloss.Color(flexokiBase200) - theme.MarkdownListItemColor = lipgloss.Color(flexokiBlue600) - theme.MarkdownListEnumerationColor = lipgloss.Color(flexokiBlue600) - theme.MarkdownImageColor = lipgloss.Color(flexokiPurple600) - theme.MarkdownImageTextColor = lipgloss.Color(flexokiMagenta600) - theme.MarkdownCodeBlockColor = lipgloss.Color(flexokiBase600) - - // Syntax highlighting colors (based on Flexoki's mappings) - theme.SyntaxCommentColor = lipgloss.Color(flexokiBase300) // tx-3 - theme.SyntaxKeywordColor = lipgloss.Color(flexokiGreen600) // gr - theme.SyntaxFunctionColor = lipgloss.Color(flexokiOrange600) // or - theme.SyntaxVariableColor = lipgloss.Color(flexokiBlue600) // bl - theme.SyntaxStringColor = lipgloss.Color(flexokiCyan600) // cy - theme.SyntaxNumberColor = lipgloss.Color(flexokiPurple600) // pu - theme.SyntaxTypeColor = lipgloss.Color(flexokiYellow600) // ye - theme.SyntaxOperatorColor = lipgloss.Color(flexokiBase500) // tx-2 - theme.SyntaxPunctuationColor = lipgloss.Color(flexokiBase500) // tx-2 - - return theme -} - -func init() { - // Register the Flexoki themes with the theme manager - RegisterTheme("flexoki-dark", NewFlexokiDarkTheme()) - RegisterTheme("flexoki-light", NewFlexokiLightTheme()) -} diff --git a/internal/tui/theme/gruvbox.go b/internal/tui/theme/gruvbox.go deleted file mode 100644 index 0eb79b44da2d8c4d039e0073a2e755a6372f03fa..0000000000000000000000000000000000000000 --- a/internal/tui/theme/gruvbox.go +++ /dev/null @@ -1,224 +0,0 @@ -package theme - -import ( - "github.com/charmbracelet/lipgloss/v2" -) - -// Gruvbox color palette constants -const ( - // Dark theme colors - gruvboxDarkBg0 = "#282828" - gruvboxDarkBg0Soft = "#32302f" - gruvboxDarkBg1 = "#3c3836" - gruvboxDarkBg2 = "#504945" - gruvboxDarkBg3 = "#665c54" - gruvboxDarkBg4 = "#7c6f64" - gruvboxDarkFg0 = "#fbf1c7" - gruvboxDarkFg1 = "#ebdbb2" - gruvboxDarkFg2 = "#d5c4a1" - gruvboxDarkFg3 = "#bdae93" - gruvboxDarkFg4 = "#a89984" - gruvboxDarkGray = "#928374" - gruvboxDarkRed = "#cc241d" - gruvboxDarkRedBright = "#fb4934" - gruvboxDarkGreen = "#98971a" - gruvboxDarkGreenBright = "#b8bb26" - gruvboxDarkYellow = "#d79921" - gruvboxDarkYellowBright = "#fabd2f" - gruvboxDarkBlue = "#458588" - gruvboxDarkBlueBright = "#83a598" - gruvboxDarkPurple = "#b16286" - gruvboxDarkPurpleBright = "#d3869b" - gruvboxDarkAqua = "#689d6a" - gruvboxDarkAquaBright = "#8ec07c" - gruvboxDarkOrange = "#d65d0e" - gruvboxDarkOrangeBright = "#fe8019" - - // Light theme colors - gruvboxLightBg0 = "#fbf1c7" - gruvboxLightBg0Soft = "#f2e5bc" - gruvboxLightBg1 = "#ebdbb2" - gruvboxLightBg2 = "#d5c4a1" - gruvboxLightBg3 = "#bdae93" - gruvboxLightBg4 = "#a89984" - gruvboxLightFg0 = "#282828" - gruvboxLightFg1 = "#3c3836" - gruvboxLightFg2 = "#504945" - gruvboxLightFg3 = "#665c54" - gruvboxLightFg4 = "#7c6f64" - gruvboxLightGray = "#928374" - gruvboxLightRed = "#9d0006" - gruvboxLightRedBright = "#cc241d" - gruvboxLightGreen = "#79740e" - gruvboxLightGreenBright = "#98971a" - gruvboxLightYellow = "#b57614" - gruvboxLightYellowBright = "#d79921" - gruvboxLightBlue = "#076678" - gruvboxLightBlueBright = "#458588" - gruvboxLightPurple = "#8f3f71" - gruvboxLightPurpleBright = "#b16286" - gruvboxLightAqua = "#427b58" - gruvboxLightAquaBright = "#689d6a" - gruvboxLightOrange = "#af3a03" - gruvboxLightOrangeBright = "#d65d0e" -) - -// GruvboxTheme implements the Theme interface with Gruvbox colors. -// It provides both dark and light variants. -type GruvboxTheme struct { - BaseTheme -} - -// NewGruvboxTheme creates a new instance of the Gruvbox theme. -func NewGruvboxTheme() *GruvboxTheme { - theme := &GruvboxTheme{} - - // Base colors - theme.PrimaryColor = lipgloss.Color(gruvboxDarkBlueBright) - theme.SecondaryColor = lipgloss.Color(gruvboxDarkPurpleBright) - theme.AccentColor = lipgloss.Color(gruvboxDarkOrangeBright) - - // Status colors - theme.ErrorColor = lipgloss.Color(gruvboxDarkRedBright) - theme.WarningColor = lipgloss.Color(gruvboxDarkYellowBright) - theme.SuccessColor = lipgloss.Color(gruvboxDarkGreenBright) - theme.InfoColor = lipgloss.Color(gruvboxDarkBlueBright) - - // Text colors - theme.TextColor = lipgloss.Color(gruvboxDarkFg1) - theme.TextMutedColor = lipgloss.Color(gruvboxDarkFg4) - theme.TextEmphasizedColor = lipgloss.Color(gruvboxDarkYellowBright) - - // Background colors - theme.BackgroundColor = lipgloss.Color(gruvboxDarkBg0) - theme.BackgroundSecondaryColor = lipgloss.Color(gruvboxDarkBg1) - theme.BackgroundDarkerColor = lipgloss.Color(gruvboxDarkBg0Soft) - - // Border colors - theme.BorderNormalColor = lipgloss.Color(gruvboxDarkBg2) - theme.BorderFocusedColor = lipgloss.Color(gruvboxDarkBlueBright) - theme.BorderDimColor = lipgloss.Color(gruvboxDarkBg1) - - // Diff view colors - theme.DiffAddedColor = lipgloss.Color(gruvboxDarkGreenBright) - theme.DiffRemovedColor = lipgloss.Color(gruvboxDarkRedBright) - theme.DiffContextColor = lipgloss.Color(gruvboxDarkFg4) - theme.DiffHunkHeaderColor = lipgloss.Color(gruvboxDarkFg3) - theme.DiffHighlightAddedColor = lipgloss.Color(gruvboxDarkGreenBright) - theme.DiffHighlightRemovedColor = lipgloss.Color(gruvboxDarkRedBright) - theme.DiffAddedBgColor = lipgloss.Color("#3C4C3C") // Darker green background - theme.DiffRemovedBgColor = lipgloss.Color("#4C3C3C") // Darker red background - theme.DiffContextBgColor = lipgloss.Color(gruvboxDarkBg0) - theme.DiffLineNumberColor = lipgloss.Color(gruvboxDarkFg4) - theme.DiffAddedLineNumberBgColor = lipgloss.Color("#32432F") // Slightly darker green - theme.DiffRemovedLineNumberBgColor = lipgloss.Color("#43322F") // Slightly darker red - - // Markdown colors - theme.MarkdownTextColor = lipgloss.Color(gruvboxDarkFg1) - theme.MarkdownHeadingColor = lipgloss.Color(gruvboxDarkYellowBright) - theme.MarkdownLinkColor = lipgloss.Color(gruvboxDarkBlueBright) - theme.MarkdownLinkTextColor = lipgloss.Color(gruvboxDarkAquaBright) - theme.MarkdownCodeColor = lipgloss.Color(gruvboxDarkGreenBright) - theme.MarkdownBlockQuoteColor = lipgloss.Color(gruvboxDarkAquaBright) - theme.MarkdownEmphColor = lipgloss.Color(gruvboxDarkYellowBright) - theme.MarkdownStrongColor = lipgloss.Color(gruvboxDarkOrangeBright) - theme.MarkdownHorizontalRuleColor = lipgloss.Color(gruvboxDarkBg3) - theme.MarkdownListItemColor = lipgloss.Color(gruvboxDarkBlueBright) - theme.MarkdownListEnumerationColor = lipgloss.Color(gruvboxDarkBlueBright) - theme.MarkdownImageColor = lipgloss.Color(gruvboxDarkPurpleBright) - theme.MarkdownImageTextColor = lipgloss.Color(gruvboxDarkAquaBright) - theme.MarkdownCodeBlockColor = lipgloss.Color(gruvboxDarkFg1) - - // Syntax highlighting colors - theme.SyntaxCommentColor = lipgloss.Color(gruvboxDarkGray) - theme.SyntaxKeywordColor = lipgloss.Color(gruvboxDarkRedBright) - theme.SyntaxFunctionColor = lipgloss.Color(gruvboxDarkGreenBright) - theme.SyntaxVariableColor = lipgloss.Color(gruvboxDarkBlueBright) - theme.SyntaxStringColor = lipgloss.Color(gruvboxDarkYellowBright) - theme.SyntaxNumberColor = lipgloss.Color(gruvboxDarkPurpleBright) - theme.SyntaxTypeColor = lipgloss.Color(gruvboxDarkYellow) - theme.SyntaxOperatorColor = lipgloss.Color(gruvboxDarkAquaBright) - theme.SyntaxPunctuationColor = lipgloss.Color(gruvboxDarkFg1) - - return theme -} - -// NewGruvboxLightTheme creates a new instance of the Gruvbox Light theme. -func NewGruvboxLightTheme() *GruvboxTheme { - theme := &GruvboxTheme{} - - // Base colors - theme.PrimaryColor = lipgloss.Color(gruvboxLightBlueBright) - theme.SecondaryColor = lipgloss.Color(gruvboxLightPurpleBright) - theme.AccentColor = lipgloss.Color(gruvboxLightOrangeBright) - - // Status colors - theme.ErrorColor = lipgloss.Color(gruvboxLightRedBright) - theme.WarningColor = lipgloss.Color(gruvboxLightYellowBright) - theme.SuccessColor = lipgloss.Color(gruvboxLightGreenBright) - theme.InfoColor = lipgloss.Color(gruvboxLightBlueBright) - - // Text colors - theme.TextColor = lipgloss.Color(gruvboxLightFg1) - theme.TextMutedColor = lipgloss.Color(gruvboxLightFg4) - theme.TextEmphasizedColor = lipgloss.Color(gruvboxLightYellowBright) - - // Background colors - theme.BackgroundColor = lipgloss.Color(gruvboxLightBg0) - theme.BackgroundSecondaryColor = lipgloss.Color(gruvboxLightBg1) - theme.BackgroundDarkerColor = lipgloss.Color(gruvboxLightBg0Soft) - - // Border colors - theme.BorderNormalColor = lipgloss.Color(gruvboxLightBg2) - theme.BorderFocusedColor = lipgloss.Color(gruvboxLightBlueBright) - theme.BorderDimColor = lipgloss.Color(gruvboxLightBg1) - - // Diff view colors - theme.DiffAddedColor = lipgloss.Color(gruvboxLightGreenBright) - theme.DiffRemovedColor = lipgloss.Color(gruvboxLightRedBright) - theme.DiffContextColor = lipgloss.Color(gruvboxLightFg4) - theme.DiffHunkHeaderColor = lipgloss.Color(gruvboxLightFg3) - theme.DiffHighlightAddedColor = lipgloss.Color(gruvboxLightGreenBright) - theme.DiffHighlightRemovedColor = lipgloss.Color(gruvboxLightRedBright) - theme.DiffAddedBgColor = lipgloss.Color("#E8F5E9") // Light green background - theme.DiffRemovedBgColor = lipgloss.Color("#FFEBEE") // Light red background - theme.DiffContextBgColor = lipgloss.Color(gruvboxLightBg0) - theme.DiffLineNumberColor = lipgloss.Color(gruvboxLightFg4) - theme.DiffAddedLineNumberBgColor = lipgloss.Color("#C8E6C9") // Light green - theme.DiffRemovedLineNumberBgColor = lipgloss.Color("#FFCDD2") // Light red - - // Markdown colors - theme.MarkdownTextColor = lipgloss.Color(gruvboxLightFg1) - theme.MarkdownHeadingColor = lipgloss.Color(gruvboxLightYellowBright) - theme.MarkdownLinkColor = lipgloss.Color(gruvboxLightBlueBright) - theme.MarkdownLinkTextColor = lipgloss.Color(gruvboxLightAquaBright) - theme.MarkdownCodeColor = lipgloss.Color(gruvboxLightGreenBright) - theme.MarkdownBlockQuoteColor = lipgloss.Color(gruvboxLightAquaBright) - theme.MarkdownEmphColor = lipgloss.Color(gruvboxLightYellowBright) - theme.MarkdownStrongColor = lipgloss.Color(gruvboxLightOrangeBright) - theme.MarkdownHorizontalRuleColor = lipgloss.Color(gruvboxLightBg3) - theme.MarkdownListItemColor = lipgloss.Color(gruvboxLightBlueBright) - theme.MarkdownListEnumerationColor = lipgloss.Color(gruvboxLightBlueBright) - theme.MarkdownImageColor = lipgloss.Color(gruvboxLightPurpleBright) - theme.MarkdownImageTextColor = lipgloss.Color(gruvboxLightAquaBright) - theme.MarkdownCodeBlockColor = lipgloss.Color(gruvboxLightFg1) - - // Syntax highlighting colors - theme.SyntaxCommentColor = lipgloss.Color(gruvboxLightGray) - theme.SyntaxKeywordColor = lipgloss.Color(gruvboxLightRedBright) - theme.SyntaxFunctionColor = lipgloss.Color(gruvboxLightGreenBright) - theme.SyntaxVariableColor = lipgloss.Color(gruvboxLightBlueBright) - theme.SyntaxStringColor = lipgloss.Color(gruvboxLightYellowBright) - theme.SyntaxNumberColor = lipgloss.Color(gruvboxLightPurpleBright) - theme.SyntaxTypeColor = lipgloss.Color(gruvboxLightYellow) - theme.SyntaxOperatorColor = lipgloss.Color(gruvboxLightAquaBright) - theme.SyntaxPunctuationColor = lipgloss.Color(gruvboxLightFg1) - - return theme -} - -func init() { - // Register the Gruvbox themes with the theme manager - RegisterTheme("gruvbox", NewGruvboxTheme()) - RegisterTheme("gruvbox-light", NewGruvboxLightTheme()) -} diff --git a/internal/tui/theme/manager.go b/internal/tui/theme/manager.go deleted file mode 100644 index e00c9f0ec9ab83dafda8c7fa97ed5496cd0a7ebb..0000000000000000000000000000000000000000 --- a/internal/tui/theme/manager.go +++ /dev/null @@ -1,124 +0,0 @@ -package theme - -import ( - "fmt" - "image/color" - "slices" - "strings" - "sync" - - "github.com/alecthomas/chroma/v2/styles" - "github.com/opencode-ai/opencode/internal/config" - "github.com/opencode-ai/opencode/internal/logging" -) - -// Manager handles theme registration, selection, and retrieval. -// It maintains a registry of available themes and tracks the currently active theme. -type Manager struct { - themes map[string]Theme - currentName string - mu sync.RWMutex -} - -// Global instance of the theme manager -var globalManager = &Manager{ - themes: make(map[string]Theme), - currentName: "", -} - -// RegisterTheme adds a new theme to the registry. -// If this is the first theme registered, it becomes the default. -func RegisterTheme(name string, theme Theme) { - globalManager.mu.Lock() - defer globalManager.mu.Unlock() - - globalManager.themes[name] = theme - - // If this is the first theme, make it the default - if globalManager.currentName == "" { - globalManager.currentName = name - } -} - -// SetTheme changes the active theme to the one with the specified name. -// Returns an error if the theme doesn't exist. -func SetTheme(name string) error { - globalManager.mu.Lock() - defer globalManager.mu.Unlock() - - delete(styles.Registry, "charm") - if _, exists := globalManager.themes[name]; !exists { - return fmt.Errorf("theme '%s' not found", name) - } - - globalManager.currentName = name - - // Update the config file using viper - if err := updateConfigTheme(name); err != nil { - // Log the error but don't fail the theme change - logging.Warn("Warning: Failed to update config file with new theme", "err", err) - } - - return nil -} - -// CurrentTheme returns the currently active theme. -// If no theme is set, it returns nil. -func CurrentTheme() Theme { - globalManager.mu.RLock() - defer globalManager.mu.RUnlock() - - if globalManager.currentName == "" { - return nil - } - - return globalManager.themes[globalManager.currentName] -} - -func GetColor(c color.Color) string { - rgba := color.RGBAModel.Convert(c).(color.RGBA) - return fmt.Sprintf("#%02x%02x%02x", rgba.R, rgba.G, rgba.B) -} - -// CurrentThemeName returns the name of the currently active theme. -func CurrentThemeName() string { - globalManager.mu.RLock() - defer globalManager.mu.RUnlock() - - return globalManager.currentName -} - -// AvailableThemes returns a list of all registered theme names. -func AvailableThemes() []string { - globalManager.mu.RLock() - defer globalManager.mu.RUnlock() - - names := make([]string, 0, len(globalManager.themes)) - for name := range globalManager.themes { - names = append(names, name) - } - slices.SortFunc(names, func(a, b string) int { - if a == "opencode" { - return -1 - } else if b == "opencode" { - return 1 - } - return strings.Compare(a, b) - }) - return names -} - -// GetTheme returns a specific theme by name. -// Returns nil if the theme doesn't exist. -func GetTheme(name string) Theme { - globalManager.mu.RLock() - defer globalManager.mu.RUnlock() - - return globalManager.themes[name] -} - -// updateConfigTheme updates the theme setting in the configuration file -func updateConfigTheme(themeName string) error { - // Use the config package to update the theme - return config.UpdateTheme(themeName) -} diff --git a/internal/tui/theme/monokai.go b/internal/tui/theme/monokai.go deleted file mode 100644 index abe342906d156da8128df30599a0056b525e05e2..0000000000000000000000000000000000000000 --- a/internal/tui/theme/monokai.go +++ /dev/null @@ -1,195 +0,0 @@ -package theme - -import ( - "github.com/charmbracelet/lipgloss/v2" -) - -// MonokaiProTheme implements the Theme interface with Monokai Pro colors. -// It provides both dark and light variants. -type MonokaiProTheme struct { - BaseTheme -} - -// NewMonokaiProTheme creates a new instance of the Monokai Pro theme. -func NewMonokaiProTheme() *MonokaiProTheme { - // Monokai Pro color palette (dark mode) - darkBackground := "#2d2a2e" - darkCurrentLine := "#403e41" - darkSelection := "#5b595c" - darkForeground := "#fcfcfa" - darkComment := "#727072" - darkRed := "#ff6188" - darkOrange := "#fc9867" - darkYellow := "#ffd866" - darkGreen := "#a9dc76" - darkCyan := "#78dce8" - darkBlue := "#ab9df2" - darkPurple := "#ab9df2" - darkBorder := "#403e41" - - theme := &MonokaiProTheme{} - - // Base colors - theme.PrimaryColor = lipgloss.Color(darkCyan) - theme.SecondaryColor = lipgloss.Color(darkPurple) - theme.AccentColor = lipgloss.Color(darkOrange) - - // Status colors - theme.ErrorColor = lipgloss.Color(darkRed) - theme.WarningColor = lipgloss.Color(darkOrange) - theme.SuccessColor = lipgloss.Color(darkGreen) - theme.InfoColor = lipgloss.Color(darkBlue) - - // Text colors - theme.TextColor = lipgloss.Color(darkForeground) - theme.TextMutedColor = lipgloss.Color(darkComment) - theme.TextEmphasizedColor = lipgloss.Color(darkYellow) - - // Background colors - theme.BackgroundColor = lipgloss.Color(darkBackground) - theme.BackgroundSecondaryColor = lipgloss.Color(darkCurrentLine) - theme.BackgroundDarkerColor = lipgloss.Color("#221f22") // Slightly darker than background - - // Border colors - theme.BorderNormalColor = lipgloss.Color(darkBorder) - theme.BorderFocusedColor = lipgloss.Color(darkCyan) - theme.BorderDimColor = lipgloss.Color(darkSelection) - - // Diff view colors - theme.DiffAddedColor = lipgloss.Color("#a9dc76") - theme.DiffRemovedColor = lipgloss.Color("#ff6188") - theme.DiffContextColor = lipgloss.Color("#a0a0a0") - theme.DiffHunkHeaderColor = lipgloss.Color("#a0a0a0") - theme.DiffHighlightAddedColor = lipgloss.Color("#c2e7a9") - theme.DiffHighlightRemovedColor = lipgloss.Color("#ff8ca6") - theme.DiffAddedBgColor = lipgloss.Color("#3a4a35") - theme.DiffRemovedBgColor = lipgloss.Color("#4a3439") - theme.DiffContextBgColor = lipgloss.Color(darkBackground) - theme.DiffLineNumberColor = lipgloss.Color("#888888") - theme.DiffAddedLineNumberBgColor = lipgloss.Color("#2d3a28") - theme.DiffRemovedLineNumberBgColor = lipgloss.Color("#3d2a2e") - - // Markdown colors - theme.MarkdownTextColor = lipgloss.Color(darkForeground) - theme.MarkdownHeadingColor = lipgloss.Color(darkPurple) - theme.MarkdownLinkColor = lipgloss.Color(darkCyan) - theme.MarkdownLinkTextColor = lipgloss.Color(darkBlue) - theme.MarkdownCodeColor = lipgloss.Color(darkGreen) - theme.MarkdownBlockQuoteColor = lipgloss.Color(darkYellow) - theme.MarkdownEmphColor = lipgloss.Color(darkYellow) - theme.MarkdownStrongColor = lipgloss.Color(darkOrange) - theme.MarkdownHorizontalRuleColor = lipgloss.Color(darkComment) - theme.MarkdownListItemColor = lipgloss.Color(darkCyan) - theme.MarkdownListEnumerationColor = lipgloss.Color(darkBlue) - theme.MarkdownImageColor = lipgloss.Color(darkCyan) - theme.MarkdownImageTextColor = lipgloss.Color(darkBlue) - theme.MarkdownCodeBlockColor = lipgloss.Color(darkForeground) - - // Syntax highlighting colors - theme.SyntaxCommentColor = lipgloss.Color(darkComment) - theme.SyntaxKeywordColor = lipgloss.Color(darkRed) - theme.SyntaxFunctionColor = lipgloss.Color(darkGreen) - theme.SyntaxVariableColor = lipgloss.Color(darkForeground) - theme.SyntaxStringColor = lipgloss.Color(darkYellow) - theme.SyntaxNumberColor = lipgloss.Color(darkPurple) - theme.SyntaxTypeColor = lipgloss.Color(darkBlue) - theme.SyntaxOperatorColor = lipgloss.Color(darkCyan) - theme.SyntaxPunctuationColor = lipgloss.Color(darkForeground) - - return theme -} - -// NewMonokaiProLightTheme creates a new instance of the Monokai Pro Light theme. -func NewMonokaiProLightTheme() *MonokaiProTheme { - // Light mode colors (adapted from dark) - lightBackground := "#fafafa" - lightCurrentLine := "#f0f0f0" - lightSelection := "#e5e5e6" - lightForeground := "#2d2a2e" - lightComment := "#939293" - lightRed := "#f92672" - lightOrange := "#fd971f" - lightYellow := "#e6db74" - lightGreen := "#9bca65" - lightCyan := "#66d9ef" - lightBlue := "#7e75db" - lightPurple := "#ae81ff" - lightBorder := "#d3d3d3" - - theme := &MonokaiProTheme{} - - // Base colors - theme.PrimaryColor = lipgloss.Color(lightCyan) - theme.SecondaryColor = lipgloss.Color(lightPurple) - theme.AccentColor = lipgloss.Color(lightOrange) - - // Status colors - theme.ErrorColor = lipgloss.Color(lightRed) - theme.WarningColor = lipgloss.Color(lightOrange) - theme.SuccessColor = lipgloss.Color(lightGreen) - theme.InfoColor = lipgloss.Color(lightBlue) - - // Text colors - theme.TextColor = lipgloss.Color(lightForeground) - theme.TextMutedColor = lipgloss.Color(lightComment) - theme.TextEmphasizedColor = lipgloss.Color(lightYellow) - - // Background colors - theme.BackgroundColor = lipgloss.Color(lightBackground) - theme.BackgroundSecondaryColor = lipgloss.Color(lightCurrentLine) - theme.BackgroundDarkerColor = lipgloss.Color("#ffffff") // Slightly lighter than background - - // Border colors - theme.BorderNormalColor = lipgloss.Color(lightBorder) - theme.BorderFocusedColor = lipgloss.Color(lightCyan) - theme.BorderDimColor = lipgloss.Color(lightSelection) - - // Diff view colors - theme.DiffAddedColor = lipgloss.Color("#9bca65") - theme.DiffRemovedColor = lipgloss.Color("#f92672") - theme.DiffContextColor = lipgloss.Color("#757575") - theme.DiffHunkHeaderColor = lipgloss.Color("#757575") - theme.DiffHighlightAddedColor = lipgloss.Color("#c5e0b4") - theme.DiffHighlightRemovedColor = lipgloss.Color("#ffb3c8") - theme.DiffAddedBgColor = lipgloss.Color("#e8f5e9") - theme.DiffRemovedBgColor = lipgloss.Color("#ffebee") - theme.DiffContextBgColor = lipgloss.Color(lightBackground) - theme.DiffLineNumberColor = lipgloss.Color("#9e9e9e") - theme.DiffAddedLineNumberBgColor = lipgloss.Color("#c8e6c9") - theme.DiffRemovedLineNumberBgColor = lipgloss.Color("#ffcdd2") - - // Markdown colors - theme.MarkdownTextColor = lipgloss.Color(lightForeground) - theme.MarkdownHeadingColor = lipgloss.Color(lightPurple) - theme.MarkdownLinkColor = lipgloss.Color(lightCyan) - theme.MarkdownLinkTextColor = lipgloss.Color(lightBlue) - theme.MarkdownCodeColor = lipgloss.Color(lightGreen) - theme.MarkdownBlockQuoteColor = lipgloss.Color(lightYellow) - theme.MarkdownEmphColor = lipgloss.Color(lightYellow) - theme.MarkdownStrongColor = lipgloss.Color(lightOrange) - theme.MarkdownHorizontalRuleColor = lipgloss.Color(lightComment) - theme.MarkdownListItemColor = lipgloss.Color(lightCyan) - theme.MarkdownListEnumerationColor = lipgloss.Color(lightBlue) - theme.MarkdownImageColor = lipgloss.Color(lightCyan) - theme.MarkdownImageTextColor = lipgloss.Color(lightBlue) - theme.MarkdownCodeBlockColor = lipgloss.Color(lightForeground) - - // Syntax highlighting colors - theme.SyntaxCommentColor = lipgloss.Color(lightComment) - theme.SyntaxKeywordColor = lipgloss.Color(lightRed) - theme.SyntaxFunctionColor = lipgloss.Color(lightGreen) - theme.SyntaxVariableColor = lipgloss.Color(lightForeground) - theme.SyntaxStringColor = lipgloss.Color(lightYellow) - theme.SyntaxNumberColor = lipgloss.Color(lightPurple) - theme.SyntaxTypeColor = lipgloss.Color(lightBlue) - theme.SyntaxOperatorColor = lipgloss.Color(lightCyan) - theme.SyntaxPunctuationColor = lipgloss.Color(lightForeground) - - return theme -} - -func init() { - // Register the Monokai Pro themes with the theme manager - RegisterTheme("monokai", NewMonokaiProTheme()) - RegisterTheme("monokai-light", NewMonokaiProLightTheme()) -} diff --git a/internal/tui/theme/onedark.go b/internal/tui/theme/onedark.go deleted file mode 100644 index 5c694b2837f0c4a86ab4d5b85705847c739c1f4d..0000000000000000000000000000000000000000 --- a/internal/tui/theme/onedark.go +++ /dev/null @@ -1,196 +0,0 @@ -package theme - -import ( - "github.com/charmbracelet/lipgloss/v2" -) - -// OneDarkTheme implements the Theme interface with Atom's One Dark colors. -// It provides both dark and light variants. -type OneDarkTheme struct { - BaseTheme -} - -// NewOneDarkTheme creates a new instance of the One Dark theme. -func NewOneDarkTheme() *OneDarkTheme { - // One Dark color palette - // Dark mode colors from Atom One Dark - darkBackground := "#282c34" - darkCurrentLine := "#2c313c" - darkSelection := "#3e4451" - darkForeground := "#abb2bf" - darkComment := "#5c6370" - darkRed := "#e06c75" - darkOrange := "#d19a66" - darkYellow := "#e5c07b" - darkGreen := "#98c379" - darkCyan := "#56b6c2" - darkBlue := "#61afef" - darkPurple := "#c678dd" - darkBorder := "#3b4048" - - theme := &OneDarkTheme{} - - // Base colors - theme.PrimaryColor = lipgloss.Color(darkBlue) - theme.SecondaryColor = lipgloss.Color(darkPurple) - theme.AccentColor = lipgloss.Color(darkOrange) - - // Status colors - theme.ErrorColor = lipgloss.Color(darkRed) - theme.WarningColor = lipgloss.Color(darkOrange) - theme.SuccessColor = lipgloss.Color(darkGreen) - theme.InfoColor = lipgloss.Color(darkBlue) - - // Text colors - theme.TextColor = lipgloss.Color(darkForeground) - theme.TextMutedColor = lipgloss.Color(darkComment) - theme.TextEmphasizedColor = lipgloss.Color(darkYellow) - - // Background colors - theme.BackgroundColor = lipgloss.Color(darkBackground) - theme.BackgroundSecondaryColor = lipgloss.Color(darkCurrentLine) - theme.BackgroundDarkerColor = lipgloss.Color("#21252b") // Slightly darker than background - - // Border colors - theme.BorderNormalColor = lipgloss.Color(darkBorder) - theme.BorderFocusedColor = lipgloss.Color(darkBlue) - theme.BorderDimColor = lipgloss.Color(darkSelection) - - // Diff view colors - theme.DiffAddedColor = lipgloss.Color("#478247") - theme.DiffRemovedColor = lipgloss.Color("#7C4444") - theme.DiffContextColor = lipgloss.Color("#a0a0a0") - theme.DiffHunkHeaderColor = lipgloss.Color("#a0a0a0") - theme.DiffHighlightAddedColor = lipgloss.Color("#DAFADA") - theme.DiffHighlightRemovedColor = lipgloss.Color("#FADADD") - theme.DiffAddedBgColor = lipgloss.Color("#303A30") - theme.DiffRemovedBgColor = lipgloss.Color("#3A3030") - theme.DiffContextBgColor = lipgloss.Color(darkBackground) - theme.DiffLineNumberColor = lipgloss.Color("#888888") - theme.DiffAddedLineNumberBgColor = lipgloss.Color("#293229") - theme.DiffRemovedLineNumberBgColor = lipgloss.Color("#332929") - - // Markdown colors - theme.MarkdownTextColor = lipgloss.Color(darkForeground) - theme.MarkdownHeadingColor = lipgloss.Color(darkPurple) - theme.MarkdownLinkColor = lipgloss.Color(darkBlue) - theme.MarkdownLinkTextColor = lipgloss.Color(darkCyan) - theme.MarkdownCodeColor = lipgloss.Color(darkGreen) - theme.MarkdownBlockQuoteColor = lipgloss.Color(darkYellow) - theme.MarkdownEmphColor = lipgloss.Color(darkYellow) - theme.MarkdownStrongColor = lipgloss.Color(darkOrange) - theme.MarkdownHorizontalRuleColor = lipgloss.Color(darkComment) - theme.MarkdownListItemColor = lipgloss.Color(darkBlue) - theme.MarkdownListEnumerationColor = lipgloss.Color(darkCyan) - theme.MarkdownImageColor = lipgloss.Color(darkBlue) - theme.MarkdownImageTextColor = lipgloss.Color(darkCyan) - theme.MarkdownCodeBlockColor = lipgloss.Color(darkForeground) - - // Syntax highlighting colors - theme.SyntaxCommentColor = lipgloss.Color(darkComment) - theme.SyntaxKeywordColor = lipgloss.Color(darkPurple) - theme.SyntaxFunctionColor = lipgloss.Color(darkBlue) - theme.SyntaxVariableColor = lipgloss.Color(darkRed) - theme.SyntaxStringColor = lipgloss.Color(darkGreen) - theme.SyntaxNumberColor = lipgloss.Color(darkOrange) - theme.SyntaxTypeColor = lipgloss.Color(darkYellow) - theme.SyntaxOperatorColor = lipgloss.Color(darkCyan) - theme.SyntaxPunctuationColor = lipgloss.Color(darkForeground) - - return theme -} - -// NewOneLightTheme creates a new instance of the One Light theme. -func NewOneLightTheme() *OneDarkTheme { - // Light mode colors from Atom One Light - lightBackground := "#fafafa" - lightCurrentLine := "#f0f0f0" - lightSelection := "#e5e5e6" - lightForeground := "#383a42" - lightComment := "#a0a1a7" - lightRed := "#e45649" - lightOrange := "#da8548" - lightYellow := "#c18401" - lightGreen := "#50a14f" - lightCyan := "#0184bc" - lightBlue := "#4078f2" - lightPurple := "#a626a4" - lightBorder := "#d3d3d3" - - theme := &OneDarkTheme{} - - // Base colors - theme.PrimaryColor = lipgloss.Color(lightBlue) - theme.SecondaryColor = lipgloss.Color(lightPurple) - theme.AccentColor = lipgloss.Color(lightOrange) - - // Status colors - theme.ErrorColor = lipgloss.Color(lightRed) - theme.WarningColor = lipgloss.Color(lightOrange) - theme.SuccessColor = lipgloss.Color(lightGreen) - theme.InfoColor = lipgloss.Color(lightBlue) - - // Text colors - theme.TextColor = lipgloss.Color(lightForeground) - theme.TextMutedColor = lipgloss.Color(lightComment) - theme.TextEmphasizedColor = lipgloss.Color(lightYellow) - - // Background colors - theme.BackgroundColor = lipgloss.Color(lightBackground) - theme.BackgroundSecondaryColor = lipgloss.Color(lightCurrentLine) - theme.BackgroundDarkerColor = lipgloss.Color("#ffffff") // Slightly lighter than background - - // Border colors - theme.BorderNormalColor = lipgloss.Color(lightBorder) - theme.BorderFocusedColor = lipgloss.Color(lightBlue) - theme.BorderDimColor = lipgloss.Color(lightSelection) - - // Diff view colors - theme.DiffAddedColor = lipgloss.Color("#2E7D32") - theme.DiffRemovedColor = lipgloss.Color("#C62828") - theme.DiffContextColor = lipgloss.Color("#757575") - theme.DiffHunkHeaderColor = lipgloss.Color("#757575") - theme.DiffHighlightAddedColor = lipgloss.Color("#A5D6A7") - theme.DiffHighlightRemovedColor = lipgloss.Color("#EF9A9A") - theme.DiffAddedBgColor = lipgloss.Color("#E8F5E9") - theme.DiffRemovedBgColor = lipgloss.Color("#FFEBEE") - theme.DiffContextBgColor = lipgloss.Color(lightBackground) - theme.DiffLineNumberColor = lipgloss.Color("#9E9E9E") - theme.DiffAddedLineNumberBgColor = lipgloss.Color("#C8E6C9") - theme.DiffRemovedLineNumberBgColor = lipgloss.Color("#FFCDD2") - - // Markdown colors - theme.MarkdownTextColor = lipgloss.Color(lightForeground) - theme.MarkdownHeadingColor = lipgloss.Color(lightPurple) - theme.MarkdownLinkColor = lipgloss.Color(lightBlue) - theme.MarkdownLinkTextColor = lipgloss.Color(lightCyan) - theme.MarkdownCodeColor = lipgloss.Color(lightGreen) - theme.MarkdownBlockQuoteColor = lipgloss.Color(lightYellow) - theme.MarkdownEmphColor = lipgloss.Color(lightYellow) - theme.MarkdownStrongColor = lipgloss.Color(lightOrange) - theme.MarkdownHorizontalRuleColor = lipgloss.Color(lightComment) - theme.MarkdownListItemColor = lipgloss.Color(lightBlue) - theme.MarkdownListEnumerationColor = lipgloss.Color(lightCyan) - theme.MarkdownImageColor = lipgloss.Color(lightBlue) - theme.MarkdownImageTextColor = lipgloss.Color(lightCyan) - theme.MarkdownCodeBlockColor = lipgloss.Color(lightForeground) - - // Syntax highlighting colors - theme.SyntaxCommentColor = lipgloss.Color(lightComment) - theme.SyntaxKeywordColor = lipgloss.Color(lightPurple) - theme.SyntaxFunctionColor = lipgloss.Color(lightBlue) - theme.SyntaxVariableColor = lipgloss.Color(lightRed) - theme.SyntaxStringColor = lipgloss.Color(lightGreen) - theme.SyntaxNumberColor = lipgloss.Color(lightOrange) - theme.SyntaxTypeColor = lipgloss.Color(lightYellow) - theme.SyntaxOperatorColor = lipgloss.Color(lightCyan) - theme.SyntaxPunctuationColor = lipgloss.Color(lightForeground) - - return theme -} - -func init() { - // Register the One Dark and One Light themes with the theme manager - RegisterTheme("onedark", NewOneDarkTheme()) - RegisterTheme("onelight", NewOneLightTheme()) -} diff --git a/internal/tui/theme/opencode.go b/internal/tui/theme/opencode.go deleted file mode 100644 index 40bbaeca95066615e8abc3c9e8984e8f5f530a9d..0000000000000000000000000000000000000000 --- a/internal/tui/theme/opencode.go +++ /dev/null @@ -1,199 +0,0 @@ -package theme - -import ( - "github.com/charmbracelet/lipgloss/v2" -) - -// OpenCodeTheme implements the Theme interface with OpenCode brand colors. -// It provides both dark and light variants. -type OpenCodeTheme struct { - BaseTheme -} - -// NewOpenCodeDarkTheme creates a new instance of the OpenCode Dark theme. -func NewOpenCodeDarkTheme() *OpenCodeTheme { - // OpenCode color palette - // Dark mode colors - darkBackground := "#212121" - darkCurrentLine := "#252525" - darkSelection := "#303030" - darkForeground := "#e0e0e0" - darkComment := "#6a6a6a" - darkPrimary := "#fab283" // Primary orange/gold - darkSecondary := "#5c9cf5" // Secondary blue - darkAccent := "#9d7cd8" // Accent purple - darkRed := "#e06c75" // Error red - darkOrange := "#f5a742" // Warning orange - darkGreen := "#7fd88f" // Success green - darkCyan := "#56b6c2" // Info cyan - darkYellow := "#e5c07b" // Emphasized text - darkBorder := "#4b4c5c" // Border color - - theme := &OpenCodeTheme{} - - // Base colors - theme.PrimaryColor = lipgloss.Color(darkPrimary) - theme.SecondaryColor = lipgloss.Color(darkSecondary) - theme.AccentColor = lipgloss.Color(darkAccent) - - // Status colors - theme.ErrorColor = lipgloss.Color(darkRed) - theme.WarningColor = lipgloss.Color(darkOrange) - theme.SuccessColor = lipgloss.Color(darkGreen) - theme.InfoColor = lipgloss.Color(darkCyan) - - // Text colors - theme.TextColor = lipgloss.Color(darkForeground) - theme.TextMutedColor = lipgloss.Color(darkComment) - theme.TextEmphasizedColor = lipgloss.Color(darkYellow) - - // Background colors - theme.BackgroundColor = lipgloss.Color(darkBackground) - theme.BackgroundSecondaryColor = lipgloss.Color(darkCurrentLine) - theme.BackgroundDarkerColor = lipgloss.Color("#121212") // Slightly darker than background - - // Border colors - theme.BorderNormalColor = lipgloss.Color(darkBorder) - theme.BorderFocusedColor = lipgloss.Color(darkPrimary) - theme.BorderDimColor = lipgloss.Color(darkSelection) - - // Diff view colors - theme.DiffAddedColor = lipgloss.Color("#478247") - theme.DiffRemovedColor = lipgloss.Color("#7C4444") - theme.DiffContextColor = lipgloss.Color("#a0a0a0") - theme.DiffHunkHeaderColor = lipgloss.Color("#a0a0a0") - // TODO: change these colors to be what we want - theme.DiffHighlightAddedColor = lipgloss.Color("#256125") - theme.DiffHighlightRemovedColor = lipgloss.Color("#612726") - theme.DiffAddedBgColor = lipgloss.Color("#303A30") - theme.DiffRemovedBgColor = lipgloss.Color("#3A3030") - theme.DiffContextBgColor = lipgloss.Color(darkBackground) - theme.DiffLineNumberColor = lipgloss.Color("#888888") - theme.DiffAddedLineNumberBgColor = lipgloss.Color("#293229") - theme.DiffRemovedLineNumberBgColor = lipgloss.Color("#332929") - - // Markdown colors - theme.MarkdownTextColor = lipgloss.Color(darkForeground) - theme.MarkdownHeadingColor = lipgloss.Color(darkSecondary) - theme.MarkdownLinkColor = lipgloss.Color(darkPrimary) - theme.MarkdownLinkTextColor = lipgloss.Color(darkCyan) - theme.MarkdownCodeColor = lipgloss.Color(darkGreen) - theme.MarkdownBlockQuoteColor = lipgloss.Color(darkYellow) - theme.MarkdownEmphColor = lipgloss.Color(darkYellow) - theme.MarkdownStrongColor = lipgloss.Color(darkAccent) - theme.MarkdownHorizontalRuleColor = lipgloss.Color(darkComment) - theme.MarkdownListItemColor = lipgloss.Color(darkPrimary) - theme.MarkdownListEnumerationColor = lipgloss.Color(darkCyan) - theme.MarkdownImageColor = lipgloss.Color(darkPrimary) - theme.MarkdownImageTextColor = lipgloss.Color(darkCyan) - theme.MarkdownCodeBlockColor = lipgloss.Color(darkForeground) - - // Syntax highlighting colors - theme.SyntaxCommentColor = lipgloss.Color(darkComment) - theme.SyntaxKeywordColor = lipgloss.Color(darkSecondary) - theme.SyntaxFunctionColor = lipgloss.Color(darkPrimary) - theme.SyntaxVariableColor = lipgloss.Color(darkRed) - theme.SyntaxStringColor = lipgloss.Color(darkGreen) - theme.SyntaxNumberColor = lipgloss.Color(darkAccent) - theme.SyntaxTypeColor = lipgloss.Color(darkYellow) - theme.SyntaxOperatorColor = lipgloss.Color(darkCyan) - theme.SyntaxPunctuationColor = lipgloss.Color(darkForeground) - - return theme -} - -// NewOpenCodeLightTheme creates a new instance of the OpenCode Light theme. -func NewOpenCodeLightTheme() *OpenCodeTheme { - // Light mode colors - lightBackground := "#f8f8f8" - lightCurrentLine := "#f0f0f0" - lightSelection := "#e5e5e6" - lightForeground := "#2a2a2a" - lightComment := "#8a8a8a" - lightPrimary := "#3b7dd8" // Primary blue - lightSecondary := "#7b5bb6" // Secondary purple - lightAccent := "#d68c27" // Accent orange/gold - lightRed := "#d1383d" // Error red - lightOrange := "#d68c27" // Warning orange - lightGreen := "#3d9a57" // Success green - lightCyan := "#318795" // Info cyan - lightYellow := "#b0851f" // Emphasized text - lightBorder := "#d3d3d3" // Border color - - theme := &OpenCodeTheme{} - - // Base colors - theme.PrimaryColor = lipgloss.Color(lightPrimary) - theme.SecondaryColor = lipgloss.Color(lightSecondary) - theme.AccentColor = lipgloss.Color(lightAccent) - - // Status colors - theme.ErrorColor = lipgloss.Color(lightRed) - theme.WarningColor = lipgloss.Color(lightOrange) - theme.SuccessColor = lipgloss.Color(lightGreen) - theme.InfoColor = lipgloss.Color(lightCyan) - - // Text colors - theme.TextColor = lipgloss.Color(lightForeground) - theme.TextMutedColor = lipgloss.Color(lightComment) - theme.TextEmphasizedColor = lipgloss.Color(lightYellow) - - // Background colors - theme.BackgroundColor = lipgloss.Color(lightBackground) - theme.BackgroundSecondaryColor = lipgloss.Color(lightCurrentLine) - theme.BackgroundDarkerColor = lipgloss.Color("#ffffff") // Slightly lighter than background - - // Border colors - theme.BorderNormalColor = lipgloss.Color(lightBorder) - theme.BorderFocusedColor = lipgloss.Color(lightPrimary) - theme.BorderDimColor = lipgloss.Color(lightSelection) - - // Diff view colors - theme.DiffAddedColor = lipgloss.Color("#2E7D32") - theme.DiffRemovedColor = lipgloss.Color("#C62828") - theme.DiffContextColor = lipgloss.Color("#757575") - theme.DiffHunkHeaderColor = lipgloss.Color("#757575") - theme.DiffHighlightAddedColor = lipgloss.Color("#A5D6A7") - theme.DiffHighlightRemovedColor = lipgloss.Color("#EF9A9A") - theme.DiffAddedBgColor = lipgloss.Color("#E8F5E9") - theme.DiffRemovedBgColor = lipgloss.Color("#FFEBEE") - theme.DiffContextBgColor = lipgloss.Color(lightBackground) - theme.DiffLineNumberColor = lipgloss.Color("#9E9E9E") - theme.DiffAddedLineNumberBgColor = lipgloss.Color("#C8E6C9") - theme.DiffRemovedLineNumberBgColor = lipgloss.Color("#FFCDD2") - - // Markdown colors - theme.MarkdownTextColor = lipgloss.Color(lightForeground) - theme.MarkdownHeadingColor = lipgloss.Color(lightSecondary) - theme.MarkdownLinkColor = lipgloss.Color(lightPrimary) - theme.MarkdownLinkTextColor = lipgloss.Color(lightCyan) - theme.MarkdownCodeColor = lipgloss.Color(lightGreen) - theme.MarkdownBlockQuoteColor = lipgloss.Color(lightYellow) - theme.MarkdownEmphColor = lipgloss.Color(lightYellow) - theme.MarkdownStrongColor = lipgloss.Color(lightAccent) - theme.MarkdownHorizontalRuleColor = lipgloss.Color(lightComment) - theme.MarkdownListItemColor = lipgloss.Color(lightPrimary) - theme.MarkdownListEnumerationColor = lipgloss.Color(lightCyan) - theme.MarkdownImageColor = lipgloss.Color(lightPrimary) - theme.MarkdownImageTextColor = lipgloss.Color(lightCyan) - theme.MarkdownCodeBlockColor = lipgloss.Color(lightForeground) - - // Syntax highlighting colors - theme.SyntaxCommentColor = lipgloss.Color(lightComment) - theme.SyntaxKeywordColor = lipgloss.Color(lightSecondary) - theme.SyntaxFunctionColor = lipgloss.Color(lightPrimary) - theme.SyntaxVariableColor = lipgloss.Color(lightRed) - theme.SyntaxStringColor = lipgloss.Color(lightGreen) - theme.SyntaxNumberColor = lipgloss.Color(lightAccent) - theme.SyntaxTypeColor = lipgloss.Color(lightYellow) - theme.SyntaxOperatorColor = lipgloss.Color(lightCyan) - theme.SyntaxPunctuationColor = lipgloss.Color(lightForeground) - - return theme -} - -func init() { - // Register the OpenCode themes with the theme manager - RegisterTheme("opencode-dark", NewOpenCodeDarkTheme()) - RegisterTheme("opencode-light", NewOpenCodeLightTheme()) -} diff --git a/internal/tui/theme/theme.go b/internal/tui/theme/theme.go deleted file mode 100644 index c2221b5483f3de37c02df01ee71ed8b0e4ac01f8..0000000000000000000000000000000000000000 --- a/internal/tui/theme/theme.go +++ /dev/null @@ -1,205 +0,0 @@ -package theme - -import ( - "image/color" -) - -type Theme interface { - // Base colors - Primary() color.Color - Secondary() color.Color - Accent() color.Color - - // Status colors - Error() color.Color - Warning() color.Color - Success() color.Color - Info() color.Color - - // Text colors - Text() color.Color - TextMuted() color.Color - TextEmphasized() color.Color - - // Background colors - Background() color.Color - BackgroundSecondary() color.Color - BackgroundDarker() color.Color - - // Border colors - BorderNormal() color.Color - BorderFocused() color.Color - BorderDim() color.Color - - // Diff view colors - DiffAdded() color.Color - DiffRemoved() color.Color - DiffContext() color.Color - DiffHunkHeader() color.Color - DiffHighlightAdded() color.Color - DiffHighlightRemoved() color.Color - DiffAddedBg() color.Color - DiffRemovedBg() color.Color - DiffContextBg() color.Color - DiffLineNumber() color.Color - DiffAddedLineNumberBg() color.Color - DiffRemovedLineNumberBg() color.Color - - // Markdown colors - MarkdownText() color.Color - MarkdownHeading() color.Color - MarkdownLink() color.Color - MarkdownLinkText() color.Color - MarkdownCode() color.Color - MarkdownBlockQuote() color.Color - MarkdownEmph() color.Color - MarkdownStrong() color.Color - MarkdownHorizontalRule() color.Color - MarkdownListItem() color.Color - MarkdownListEnumeration() color.Color - MarkdownImage() color.Color - MarkdownImageText() color.Color - MarkdownCodeBlock() color.Color - - // Syntax highlighting colors - SyntaxComment() color.Color - SyntaxKeyword() color.Color - SyntaxFunction() color.Color - SyntaxVariable() color.Color - SyntaxString() color.Color - SyntaxNumber() color.Color - SyntaxType() color.Color - SyntaxOperator() color.Color - SyntaxPunctuation() color.Color -} - -// BaseTheme provides a default implementation of the Theme interface -// that can be embedded in concrete theme implementations. -type BaseTheme struct { - // Base colors - PrimaryColor color.Color - SecondaryColor color.Color - AccentColor color.Color - - // Status colors - ErrorColor color.Color - WarningColor color.Color - SuccessColor color.Color - InfoColor color.Color - - // Text colors - TextColor color.Color - TextMutedColor color.Color - TextEmphasizedColor color.Color - - // Background colors - BackgroundColor color.Color - BackgroundSecondaryColor color.Color - BackgroundDarkerColor color.Color - - // Border colors - BorderNormalColor color.Color - BorderFocusedColor color.Color - BorderDimColor color.Color - - // Diff view colors - DiffAddedColor color.Color - DiffRemovedColor color.Color - DiffContextColor color.Color - DiffHunkHeaderColor color.Color - DiffHighlightAddedColor color.Color - DiffHighlightRemovedColor color.Color - DiffAddedBgColor color.Color - DiffRemovedBgColor color.Color - DiffContextBgColor color.Color - DiffLineNumberColor color.Color - DiffAddedLineNumberBgColor color.Color - DiffRemovedLineNumberBgColor color.Color - - // Markdown colors - MarkdownTextColor color.Color - MarkdownHeadingColor color.Color - MarkdownLinkColor color.Color - MarkdownLinkTextColor color.Color - MarkdownCodeColor color.Color - MarkdownBlockQuoteColor color.Color - MarkdownEmphColor color.Color - MarkdownStrongColor color.Color - MarkdownHorizontalRuleColor color.Color - MarkdownListItemColor color.Color - MarkdownListEnumerationColor color.Color - MarkdownImageColor color.Color - MarkdownImageTextColor color.Color - MarkdownCodeBlockColor color.Color - - // Syntax highlighting colors - SyntaxCommentColor color.Color - SyntaxKeywordColor color.Color - SyntaxFunctionColor color.Color - SyntaxVariableColor color.Color - SyntaxStringColor color.Color - SyntaxNumberColor color.Color - SyntaxTypeColor color.Color - SyntaxOperatorColor color.Color - SyntaxPunctuationColor color.Color -} - -// Implement the Theme interface for BaseTheme -func (t *BaseTheme) Primary() color.Color { return t.PrimaryColor } -func (t *BaseTheme) Secondary() color.Color { return t.SecondaryColor } -func (t *BaseTheme) Accent() color.Color { return t.AccentColor } - -func (t *BaseTheme) Error() color.Color { return t.ErrorColor } -func (t *BaseTheme) Warning() color.Color { return t.WarningColor } -func (t *BaseTheme) Success() color.Color { return t.SuccessColor } -func (t *BaseTheme) Info() color.Color { return t.InfoColor } - -func (t *BaseTheme) Text() color.Color { return t.TextColor } -func (t *BaseTheme) TextMuted() color.Color { return t.TextMutedColor } -func (t *BaseTheme) TextEmphasized() color.Color { return t.TextEmphasizedColor } - -func (t *BaseTheme) Background() color.Color { return t.BackgroundColor } -func (t *BaseTheme) BackgroundSecondary() color.Color { return t.BackgroundSecondaryColor } -func (t *BaseTheme) BackgroundDarker() color.Color { return t.BackgroundDarkerColor } - -func (t *BaseTheme) BorderNormal() color.Color { return t.BorderNormalColor } -func (t *BaseTheme) BorderFocused() color.Color { return t.BorderFocusedColor } -func (t *BaseTheme) BorderDim() color.Color { return t.BorderDimColor } - -func (t *BaseTheme) DiffAdded() color.Color { return t.DiffAddedColor } -func (t *BaseTheme) DiffRemoved() color.Color { return t.DiffRemovedColor } -func (t *BaseTheme) DiffContext() color.Color { return t.DiffContextColor } -func (t *BaseTheme) DiffHunkHeader() color.Color { return t.DiffHunkHeaderColor } -func (t *BaseTheme) DiffHighlightAdded() color.Color { return t.DiffHighlightAddedColor } -func (t *BaseTheme) DiffHighlightRemoved() color.Color { return t.DiffHighlightRemovedColor } -func (t *BaseTheme) DiffAddedBg() color.Color { return t.DiffAddedBgColor } -func (t *BaseTheme) DiffRemovedBg() color.Color { return t.DiffRemovedBgColor } -func (t *BaseTheme) DiffContextBg() color.Color { return t.DiffContextBgColor } -func (t *BaseTheme) DiffLineNumber() color.Color { return t.DiffLineNumberColor } -func (t *BaseTheme) DiffAddedLineNumberBg() color.Color { return t.DiffAddedLineNumberBgColor } -func (t *BaseTheme) DiffRemovedLineNumberBg() color.Color { return t.DiffRemovedLineNumberBgColor } - -func (t *BaseTheme) MarkdownText() color.Color { return t.MarkdownTextColor } -func (t *BaseTheme) MarkdownHeading() color.Color { return t.MarkdownHeadingColor } -func (t *BaseTheme) MarkdownLink() color.Color { return t.MarkdownLinkColor } -func (t *BaseTheme) MarkdownLinkText() color.Color { return t.MarkdownLinkTextColor } -func (t *BaseTheme) MarkdownCode() color.Color { return t.MarkdownCodeColor } -func (t *BaseTheme) MarkdownBlockQuote() color.Color { return t.MarkdownBlockQuoteColor } -func (t *BaseTheme) MarkdownEmph() color.Color { return t.MarkdownEmphColor } -func (t *BaseTheme) MarkdownStrong() color.Color { return t.MarkdownStrongColor } -func (t *BaseTheme) MarkdownHorizontalRule() color.Color { return t.MarkdownHorizontalRuleColor } -func (t *BaseTheme) MarkdownListItem() color.Color { return t.MarkdownListItemColor } -func (t *BaseTheme) MarkdownListEnumeration() color.Color { return t.MarkdownListEnumerationColor } -func (t *BaseTheme) MarkdownImage() color.Color { return t.MarkdownImageColor } -func (t *BaseTheme) MarkdownImageText() color.Color { return t.MarkdownImageTextColor } -func (t *BaseTheme) MarkdownCodeBlock() color.Color { return t.MarkdownCodeBlockColor } - -func (t *BaseTheme) SyntaxComment() color.Color { return t.SyntaxCommentColor } -func (t *BaseTheme) SyntaxKeyword() color.Color { return t.SyntaxKeywordColor } -func (t *BaseTheme) SyntaxFunction() color.Color { return t.SyntaxFunctionColor } -func (t *BaseTheme) SyntaxVariable() color.Color { return t.SyntaxVariableColor } -func (t *BaseTheme) SyntaxString() color.Color { return t.SyntaxStringColor } -func (t *BaseTheme) SyntaxNumber() color.Color { return t.SyntaxNumberColor } -func (t *BaseTheme) SyntaxType() color.Color { return t.SyntaxTypeColor } -func (t *BaseTheme) SyntaxOperator() color.Color { return t.SyntaxOperatorColor } -func (t *BaseTheme) SyntaxPunctuation() color.Color { return t.SyntaxPunctuationColor } diff --git a/internal/tui/theme/theme_test.go b/internal/tui/theme/theme_test.go deleted file mode 100644 index 790ee3aa8a37a3561da92ab56431f12646d050ec..0000000000000000000000000000000000000000 --- a/internal/tui/theme/theme_test.go +++ /dev/null @@ -1,89 +0,0 @@ -package theme - -import ( - "testing" -) - -func TestThemeRegistration(t *testing.T) { - // Get list of available themes - availableThemes := AvailableThemes() - - // Check if "catppuccin" theme is registered - catppuccinFound := false - for _, themeName := range availableThemes { - if themeName == "catppuccin" { - catppuccinFound = true - break - } - } - - if !catppuccinFound { - t.Errorf("Catppuccin theme is not registered") - } - - // Check if "gruvbox" theme is registered - gruvboxFound := false - for _, themeName := range availableThemes { - if themeName == "gruvbox" { - gruvboxFound = true - break - } - } - - if !gruvboxFound { - t.Errorf("Gruvbox theme is not registered") - } - - // Check if "monokai" theme is registered - monokaiFound := false - for _, themeName := range availableThemes { - if themeName == "monokai" { - monokaiFound = true - break - } - } - - if !monokaiFound { - t.Errorf("Monokai theme is not registered") - } - - // Try to get the themes and make sure they're not nil - catppuccin := GetTheme("catppuccin") - if catppuccin == nil { - t.Errorf("Catppuccin theme is nil") - } - - gruvbox := GetTheme("gruvbox") - if gruvbox == nil { - t.Errorf("Gruvbox theme is nil") - } - - monokai := GetTheme("monokai") - if monokai == nil { - t.Errorf("Monokai theme is nil") - } - - // Test switching theme - originalTheme := CurrentThemeName() - - err := SetTheme("gruvbox") - if err != nil { - t.Errorf("Failed to set theme to gruvbox: %v", err) - } - - if CurrentThemeName() != "gruvbox" { - t.Errorf("Theme not properly switched to gruvbox") - } - - err = SetTheme("monokai") - if err != nil { - t.Errorf("Failed to set theme to monokai: %v", err) - } - - if CurrentThemeName() != "monokai" { - t.Errorf("Theme not properly switched to monokai") - } - - // Switch back to original theme - _ = SetTheme(originalTheme) -} diff --git a/internal/tui/theme/tokyonight.go b/internal/tui/theme/tokyonight.go deleted file mode 100644 index 36fd976c3d9e69ffaa7d5b5203e7f7ad4d8a15dc..0000000000000000000000000000000000000000 --- a/internal/tui/theme/tokyonight.go +++ /dev/null @@ -1,196 +0,0 @@ -package theme - -import ( - "github.com/charmbracelet/lipgloss/v2" -) - -// TokyoNightTheme implements the Theme interface with Tokyo Night colors. -// It provides both dark and light variants. -type TokyoNightTheme struct { - BaseTheme -} - -// NewTokyoNightTheme creates a new instance of the Tokyo Night theme. -func NewTokyoNightTheme() *TokyoNightTheme { - // Tokyo Night color palette - // Dark mode colors - darkBackground := "#222436" - darkCurrentLine := "#1e2030" - darkSelection := "#2f334d" - darkForeground := "#c8d3f5" - darkComment := "#636da6" - darkRed := "#ff757f" - darkOrange := "#ff966c" - darkYellow := "#ffc777" - darkGreen := "#c3e88d" - darkCyan := "#86e1fc" - darkBlue := "#82aaff" - darkPurple := "#c099ff" - darkBorder := "#3b4261" - - theme := &TokyoNightTheme{} - - // Base colors - theme.PrimaryColor = lipgloss.Color(darkBlue) - theme.SecondaryColor = lipgloss.Color(darkPurple) - theme.AccentColor = lipgloss.Color(darkOrange) - - // Status colors - theme.ErrorColor = lipgloss.Color(darkRed) - theme.WarningColor = lipgloss.Color(darkOrange) - theme.SuccessColor = lipgloss.Color(darkGreen) - theme.InfoColor = lipgloss.Color(darkBlue) - - // Text colors - theme.TextColor = lipgloss.Color(darkForeground) - theme.TextMutedColor = lipgloss.Color(darkComment) - theme.TextEmphasizedColor = lipgloss.Color(darkYellow) - - // Background colors - theme.BackgroundColor = lipgloss.Color(darkBackground) - theme.BackgroundSecondaryColor = lipgloss.Color(darkCurrentLine) - theme.BackgroundDarkerColor = lipgloss.Color("#191B29") // Darker background from palette - - // Border colors - theme.BorderNormalColor = lipgloss.Color(darkBorder) - theme.BorderFocusedColor = lipgloss.Color(darkBlue) - theme.BorderDimColor = lipgloss.Color(darkSelection) - - // Diff view colors - theme.DiffAddedColor = lipgloss.Color("#4fd6be") // teal from palette - theme.DiffRemovedColor = lipgloss.Color("#c53b53") // red1 from palette - theme.DiffContextColor = lipgloss.Color("#828bb8") // fg_dark from palette - theme.DiffHunkHeaderColor = lipgloss.Color("#828bb8") // fg_dark from palette - theme.DiffHighlightAddedColor = lipgloss.Color("#b8db87") // git.add from palette - theme.DiffHighlightRemovedColor = lipgloss.Color("#e26a75") // git.delete from palette - theme.DiffAddedBgColor = lipgloss.Color("#20303b") - theme.DiffRemovedBgColor = lipgloss.Color("#37222c") - theme.DiffContextBgColor = lipgloss.Color(darkBackground) - theme.DiffLineNumberColor = lipgloss.Color("#545c7e") // dark3 from palette - theme.DiffAddedLineNumberBgColor = lipgloss.Color("#1b2b34") - theme.DiffRemovedLineNumberBgColor = lipgloss.Color("#2d1f26") - - // Markdown colors - theme.MarkdownTextColor = lipgloss.Color(darkForeground) - theme.MarkdownHeadingColor = lipgloss.Color(darkPurple) - theme.MarkdownLinkColor = lipgloss.Color(darkBlue) - theme.MarkdownLinkTextColor = lipgloss.Color(darkCyan) - theme.MarkdownCodeColor = lipgloss.Color(darkGreen) - theme.MarkdownBlockQuoteColor = lipgloss.Color(darkYellow) - theme.MarkdownEmphColor = lipgloss.Color(darkYellow) - theme.MarkdownStrongColor = lipgloss.Color(darkOrange) - theme.MarkdownHorizontalRuleColor = lipgloss.Color(darkComment) - theme.MarkdownListItemColor = lipgloss.Color(darkBlue) - theme.MarkdownListEnumerationColor = lipgloss.Color(darkCyan) - theme.MarkdownImageColor = lipgloss.Color(darkBlue) - theme.MarkdownImageTextColor = lipgloss.Color(darkCyan) - theme.MarkdownCodeBlockColor = lipgloss.Color(darkForeground) - - // Syntax highlighting colors - theme.SyntaxCommentColor = lipgloss.Color(darkComment) - theme.SyntaxKeywordColor = lipgloss.Color(darkPurple) - theme.SyntaxFunctionColor = lipgloss.Color(darkBlue) - theme.SyntaxVariableColor = lipgloss.Color(darkRed) - theme.SyntaxStringColor = lipgloss.Color(darkGreen) - theme.SyntaxNumberColor = lipgloss.Color(darkOrange) - theme.SyntaxTypeColor = lipgloss.Color(darkYellow) - theme.SyntaxOperatorColor = lipgloss.Color(darkCyan) - theme.SyntaxPunctuationColor = lipgloss.Color(darkForeground) - - return theme -} - -// NewTokyoNightDayTheme creates a new instance of the Tokyo Night Day theme. -func NewTokyoNightDayTheme() *TokyoNightTheme { - // Light mode colors (Tokyo Night Day) - lightBackground := "#e1e2e7" - lightCurrentLine := "#d5d6db" - lightSelection := "#c8c9ce" - lightForeground := "#3760bf" - lightComment := "#848cb5" - lightRed := "#f52a65" - lightOrange := "#b15c00" - lightYellow := "#8c6c3e" - lightGreen := "#587539" - lightCyan := "#007197" - lightBlue := "#2e7de9" - lightPurple := "#9854f1" - lightBorder := "#a8aecb" - - theme := &TokyoNightTheme{} - - // Base colors - theme.PrimaryColor = lipgloss.Color(lightBlue) - theme.SecondaryColor = lipgloss.Color(lightPurple) - theme.AccentColor = lipgloss.Color(lightOrange) - - // Status colors - theme.ErrorColor = lipgloss.Color(lightRed) - theme.WarningColor = lipgloss.Color(lightOrange) - theme.SuccessColor = lipgloss.Color(lightGreen) - theme.InfoColor = lipgloss.Color(lightBlue) - - // Text colors - theme.TextColor = lipgloss.Color(lightForeground) - theme.TextMutedColor = lipgloss.Color(lightComment) - theme.TextEmphasizedColor = lipgloss.Color(lightYellow) - - // Background colors - theme.BackgroundColor = lipgloss.Color(lightBackground) - theme.BackgroundSecondaryColor = lipgloss.Color(lightCurrentLine) - theme.BackgroundDarkerColor = lipgloss.Color("#f0f0f5") // Slightly lighter than background - - // Border colors - theme.BorderNormalColor = lipgloss.Color(lightBorder) - theme.BorderFocusedColor = lipgloss.Color(lightBlue) - theme.BorderDimColor = lipgloss.Color(lightSelection) - - // Diff view colors - theme.DiffAddedColor = lipgloss.Color("#1e725c") - theme.DiffRemovedColor = lipgloss.Color("#c53b53") - theme.DiffContextColor = lipgloss.Color("#7086b5") - theme.DiffHunkHeaderColor = lipgloss.Color("#7086b5") - theme.DiffHighlightAddedColor = lipgloss.Color("#4db380") - theme.DiffHighlightRemovedColor = lipgloss.Color("#f52a65") - theme.DiffAddedBgColor = lipgloss.Color("#d5e5d5") - theme.DiffRemovedBgColor = lipgloss.Color("#f7d8db") - theme.DiffContextBgColor = lipgloss.Color(lightBackground) - theme.DiffLineNumberColor = lipgloss.Color("#848cb5") - theme.DiffAddedLineNumberBgColor = lipgloss.Color("#c5d5c5") - theme.DiffRemovedLineNumberBgColor = lipgloss.Color("#e7c8cb") - - // Markdown colors - theme.MarkdownTextColor = lipgloss.Color(lightForeground) - theme.MarkdownHeadingColor = lipgloss.Color(lightPurple) - theme.MarkdownLinkColor = lipgloss.Color(lightBlue) - theme.MarkdownLinkTextColor = lipgloss.Color(lightCyan) - theme.MarkdownCodeColor = lipgloss.Color(lightGreen) - theme.MarkdownBlockQuoteColor = lipgloss.Color(lightYellow) - theme.MarkdownEmphColor = lipgloss.Color(lightYellow) - theme.MarkdownStrongColor = lipgloss.Color(lightOrange) - theme.MarkdownHorizontalRuleColor = lipgloss.Color(lightComment) - theme.MarkdownListItemColor = lipgloss.Color(lightBlue) - theme.MarkdownListEnumerationColor = lipgloss.Color(lightCyan) - theme.MarkdownImageColor = lipgloss.Color(lightBlue) - theme.MarkdownImageTextColor = lipgloss.Color(lightCyan) - theme.MarkdownCodeBlockColor = lipgloss.Color(lightForeground) - - // Syntax highlighting colors - theme.SyntaxCommentColor = lipgloss.Color(lightComment) - theme.SyntaxKeywordColor = lipgloss.Color(lightPurple) - theme.SyntaxFunctionColor = lipgloss.Color(lightBlue) - theme.SyntaxVariableColor = lipgloss.Color(lightRed) - theme.SyntaxStringColor = lipgloss.Color(lightGreen) - theme.SyntaxNumberColor = lipgloss.Color(lightOrange) - theme.SyntaxTypeColor = lipgloss.Color(lightYellow) - theme.SyntaxOperatorColor = lipgloss.Color(lightCyan) - theme.SyntaxPunctuationColor = lipgloss.Color(lightForeground) - - return theme -} - -func init() { - // Register the Tokyo Night themes with the theme manager - RegisterTheme("tokyonight", NewTokyoNightTheme()) - RegisterTheme("tokyonight-day", NewTokyoNightDayTheme()) -} diff --git a/internal/tui/theme/tron.go b/internal/tui/theme/tron.go deleted file mode 100644 index 9e08f88c9a04e7e617f12434d8a233e2791a4b1e..0000000000000000000000000000000000000000 --- a/internal/tui/theme/tron.go +++ /dev/null @@ -1,198 +0,0 @@ -package theme - -import ( - "github.com/charmbracelet/lipgloss/v2" -) - -// TronTheme implements the Theme interface with Tron-inspired colors. -// It provides both dark and light variants, though Tron is primarily a dark theme. -type TronTheme struct { - BaseTheme -} - -// NewTronTheme creates a new instance of the Tron theme. -func NewTronTheme() *TronTheme { - // Tron color palette - // Inspired by the Tron movie's neon aesthetic - darkBackground := "#0c141f" - darkCurrentLine := "#1a2633" - darkSelection := "#1a2633" - darkForeground := "#caf0ff" - darkComment := "#4d6b87" - darkCyan := "#00d9ff" - darkBlue := "#007fff" - darkOrange := "#ff9000" - darkPink := "#ff00a0" - darkPurple := "#b73fff" - darkRed := "#ff3333" - darkYellow := "#ffcc00" - darkGreen := "#00ff8f" - darkBorder := "#1a2633" - - theme := &TronTheme{} - - // Base colors - theme.PrimaryColor = lipgloss.Color(darkCyan) - theme.SecondaryColor = lipgloss.Color(darkBlue) - theme.AccentColor = lipgloss.Color(darkOrange) - - // Status colors - theme.ErrorColor = lipgloss.Color(darkRed) - theme.WarningColor = lipgloss.Color(darkOrange) - theme.SuccessColor = lipgloss.Color(darkGreen) - theme.InfoColor = lipgloss.Color(darkCyan) - - // Text colors - theme.TextColor = lipgloss.Color(darkForeground) - theme.TextMutedColor = lipgloss.Color(darkComment) - theme.TextEmphasizedColor = lipgloss.Color(darkYellow) - - // Background colors - theme.BackgroundColor = lipgloss.Color(darkBackground) - theme.BackgroundSecondaryColor = lipgloss.Color(darkCurrentLine) - theme.BackgroundDarkerColor = lipgloss.Color("#070d14") // Slightly darker than background - - // Border colors - theme.BorderNormalColor = lipgloss.Color(darkBorder) - theme.BorderFocusedColor = lipgloss.Color(darkCyan) - theme.BorderDimColor = lipgloss.Color(darkSelection) - - // Diff view colors - theme.DiffAddedColor = lipgloss.Color(darkGreen) - theme.DiffRemovedColor = lipgloss.Color(darkRed) - theme.DiffContextColor = lipgloss.Color(darkComment) - theme.DiffHunkHeaderColor = lipgloss.Color(darkBlue) - theme.DiffHighlightAddedColor = lipgloss.Color("#00ff8f") - theme.DiffHighlightRemovedColor = lipgloss.Color("#ff3333") - theme.DiffAddedBgColor = lipgloss.Color("#0a2a1a") - theme.DiffRemovedBgColor = lipgloss.Color("#2a0a0a") - theme.DiffContextBgColor = lipgloss.Color(darkBackground) - theme.DiffLineNumberColor = lipgloss.Color(darkComment) - theme.DiffAddedLineNumberBgColor = lipgloss.Color("#082015") - theme.DiffRemovedLineNumberBgColor = lipgloss.Color("#200808") - - // Markdown colors - theme.MarkdownTextColor = lipgloss.Color(darkForeground) - theme.MarkdownHeadingColor = lipgloss.Color(darkCyan) - theme.MarkdownLinkColor = lipgloss.Color(darkBlue) - theme.MarkdownLinkTextColor = lipgloss.Color(darkCyan) - theme.MarkdownCodeColor = lipgloss.Color(darkGreen) - theme.MarkdownBlockQuoteColor = lipgloss.Color(darkYellow) - theme.MarkdownEmphColor = lipgloss.Color(darkYellow) - theme.MarkdownStrongColor = lipgloss.Color(darkOrange) - theme.MarkdownHorizontalRuleColor = lipgloss.Color(darkComment) - theme.MarkdownListItemColor = lipgloss.Color(darkBlue) - theme.MarkdownListEnumerationColor = lipgloss.Color(darkCyan) - theme.MarkdownImageColor = lipgloss.Color(darkBlue) - theme.MarkdownImageTextColor = lipgloss.Color(darkCyan) - theme.MarkdownCodeBlockColor = lipgloss.Color(darkForeground) - - // Syntax highlighting colors - theme.SyntaxCommentColor = lipgloss.Color(darkComment) - theme.SyntaxKeywordColor = lipgloss.Color(darkCyan) - theme.SyntaxFunctionColor = lipgloss.Color(darkGreen) - theme.SyntaxVariableColor = lipgloss.Color(darkOrange) - theme.SyntaxStringColor = lipgloss.Color(darkYellow) - theme.SyntaxNumberColor = lipgloss.Color(darkBlue) - theme.SyntaxTypeColor = lipgloss.Color(darkPurple) - theme.SyntaxOperatorColor = lipgloss.Color(darkPink) - theme.SyntaxPunctuationColor = lipgloss.Color(darkForeground) - - return theme -} - -// NewTronLightTheme creates a new instance of the Tron Light theme. -func NewTronLightTheme() *TronTheme { - // Light mode approximation - lightBackground := "#f0f8ff" - lightCurrentLine := "#e0f0ff" - lightSelection := "#d0e8ff" - lightForeground := "#0c141f" - lightComment := "#4d6b87" - lightCyan := "#0097b3" - lightBlue := "#0066cc" - lightOrange := "#cc7300" - lightPink := "#cc0080" - lightPurple := "#9932cc" - lightRed := "#cc2929" - lightYellow := "#cc9900" - lightGreen := "#00cc72" - lightBorder := "#d0e8ff" - - theme := &TronTheme{} - - // Base colors - theme.PrimaryColor = lipgloss.Color(lightCyan) - theme.SecondaryColor = lipgloss.Color(lightBlue) - theme.AccentColor = lipgloss.Color(lightOrange) - - // Status colors - theme.ErrorColor = lipgloss.Color(lightRed) - theme.WarningColor = lipgloss.Color(lightOrange) - theme.SuccessColor = lipgloss.Color(lightGreen) - theme.InfoColor = lipgloss.Color(lightCyan) - - // Text colors - theme.TextColor = lipgloss.Color(lightForeground) - theme.TextMutedColor = lipgloss.Color(lightComment) - theme.TextEmphasizedColor = lipgloss.Color(lightYellow) - - // Background colors - theme.BackgroundColor = lipgloss.Color(lightBackground) - theme.BackgroundSecondaryColor = lipgloss.Color(lightCurrentLine) - theme.BackgroundDarkerColor = lipgloss.Color("#ffffff") // Slightly lighter than background - - // Border colors - theme.BorderNormalColor = lipgloss.Color(lightBorder) - theme.BorderFocusedColor = lipgloss.Color(lightCyan) - theme.BorderDimColor = lipgloss.Color(lightSelection) - - // Diff view colors - theme.DiffAddedColor = lipgloss.Color(lightGreen) - theme.DiffRemovedColor = lipgloss.Color(lightRed) - theme.DiffContextColor = lipgloss.Color(lightComment) - theme.DiffHunkHeaderColor = lipgloss.Color(lightBlue) - theme.DiffHighlightAddedColor = lipgloss.Color("#a5d6a7") - theme.DiffHighlightRemovedColor = lipgloss.Color("#ef9a9a") - theme.DiffAddedBgColor = lipgloss.Color("#e8f5e9") - theme.DiffRemovedBgColor = lipgloss.Color("#ffebee") - theme.DiffContextBgColor = lipgloss.Color(lightBackground) - theme.DiffLineNumberColor = lipgloss.Color(lightComment) - theme.DiffAddedLineNumberBgColor = lipgloss.Color("#c8e6c9") - theme.DiffRemovedLineNumberBgColor = lipgloss.Color("#ffcdd2") - - // Markdown colors - theme.MarkdownTextColor = lipgloss.Color(lightForeground) - theme.MarkdownHeadingColor = lipgloss.Color(lightCyan) - theme.MarkdownLinkColor = lipgloss.Color(lightBlue) - theme.MarkdownLinkTextColor = lipgloss.Color(lightCyan) - theme.MarkdownCodeColor = lipgloss.Color(lightGreen) - theme.MarkdownBlockQuoteColor = lipgloss.Color(lightYellow) - theme.MarkdownEmphColor = lipgloss.Color(lightYellow) - theme.MarkdownStrongColor = lipgloss.Color(lightOrange) - theme.MarkdownHorizontalRuleColor = lipgloss.Color(lightComment) - theme.MarkdownListItemColor = lipgloss.Color(lightBlue) - theme.MarkdownListEnumerationColor = lipgloss.Color(lightCyan) - theme.MarkdownImageColor = lipgloss.Color(lightBlue) - theme.MarkdownImageTextColor = lipgloss.Color(lightCyan) - theme.MarkdownCodeBlockColor = lipgloss.Color(lightForeground) - - // Syntax highlighting colors - theme.SyntaxCommentColor = lipgloss.Color(lightComment) - theme.SyntaxKeywordColor = lipgloss.Color(lightCyan) - theme.SyntaxFunctionColor = lipgloss.Color(lightGreen) - theme.SyntaxVariableColor = lipgloss.Color(lightOrange) - theme.SyntaxStringColor = lipgloss.Color(lightYellow) - theme.SyntaxNumberColor = lipgloss.Color(lightBlue) - theme.SyntaxTypeColor = lipgloss.Color(lightPurple) - theme.SyntaxOperatorColor = lipgloss.Color(lightPink) - theme.SyntaxPunctuationColor = lipgloss.Color(lightForeground) - - return theme -} - -func init() { - // Register the Tron themes with the theme manager - RegisterTheme("tron", NewTronTheme()) - RegisterTheme("tron-light", NewTronLightTheme()) -}