@@ -2,7 +2,7 @@ package theme
22
33import (
44 catppuccin "github.com/catppuccin/go"
5− "github.com/charmbracelet/lipgloss"
5+ "github.com/charmbracelet/lipgloss/v2"
66)
77
88// CatppuccinTheme implements the Theme interface with Catppuccin colors.
@@ -11,238 +11,162 @@ type CatppuccinTheme struct {
1111 BaseTheme
1212}
1313
14−// NewCatppuccinTheme creates a new instance of the Catppuccin theme.
15−func NewCatppuccinTheme() *CatppuccinTheme {
16− // Get the Catppuccin palettes
14+// NewCatppuccinMochaTheme creates a new instance of the Catppuccin Mocha theme.
15+func NewCatppuccinMochaTheme() *CatppuccinTheme {
16+ // Get the Catppuccin palette
1717 mocha := catppuccin.Mocha
18+
19+ theme := &CatppuccinTheme{}
20+
21+ // Base colors
22+ theme.PrimaryColor = lipgloss.Color(mocha.Blue().Hex)
23+ theme.SecondaryColor = lipgloss.Color(mocha.Mauve().Hex)
24+ theme.AccentColor = lipgloss.Color(mocha.Peach().Hex)
25+
26+ // Status colors
27+ theme.ErrorColor = lipgloss.Color(mocha.Red().Hex)
28+ theme.WarningColor = lipgloss.Color(mocha.Peach().Hex)
29+ theme.SuccessColor = lipgloss.Color(mocha.Green().Hex)
30+ theme.InfoColor = lipgloss.Color(mocha.Blue().Hex)
31+
32+ // Text colors
33+ theme.TextColor = lipgloss.Color(mocha.Text().Hex)
34+ theme.TextMutedColor = lipgloss.Color(mocha.Subtext0().Hex)
35+ theme.TextEmphasizedColor = lipgloss.Color(mocha.Lavender().Hex)
36+
37+ // Background colors
38+ theme.BackgroundColor = lipgloss.Color("#212121") // From existing styles
39+ theme.BackgroundSecondaryColor = lipgloss.Color("#2c2c2c") // From existing styles
40+ theme.BackgroundDarkerColor = lipgloss.Color("#181818") // From existing styles
41+
42+ // Border colors
43+ theme.BorderNormalColor = lipgloss.Color("#4b4c5c") // From existing styles
44+ theme.BorderFocusedColor = lipgloss.Color(mocha.Blue().Hex)
45+ theme.BorderDimColor = lipgloss.Color(mocha.Surface0().Hex)
46+
47+ // Diff view colors
48+ theme.DiffAddedColor = lipgloss.Color("#478247") // From existing diff.go
49+ theme.DiffRemovedColor = lipgloss.Color("#7C4444") // From existing diff.go
50+ theme.DiffContextColor = lipgloss.Color("#a0a0a0") // From existing diff.go
51+ theme.DiffHunkHeaderColor = lipgloss.Color("#a0a0a0") // From existing diff.go
52+ theme.DiffHighlightAddedColor = lipgloss.Color("#DAFADA") // From existing diff.go
53+ theme.DiffHighlightRemovedColor = lipgloss.Color("#FADADD") // From existing diff.go
54+ theme.DiffAddedBgColor = lipgloss.Color("#303A30") // From existing diff.go
55+ theme.DiffRemovedBgColor = lipgloss.Color("#3A3030") // From existing diff.go
56+ theme.DiffContextBgColor = lipgloss.Color("#212121") // From existing diff.go
57+ theme.DiffLineNumberColor = lipgloss.Color("#888888") // From existing diff.go
58+ theme.DiffAddedLineNumberBgColor = lipgloss.Color("#293229") // From existing diff.go
59+ theme.DiffRemovedLineNumberBgColor = lipgloss.Color("#332929") // From existing diff.go
60+
61+ // Markdown colors
62+ theme.MarkdownTextColor = lipgloss.Color(mocha.Text().Hex)
63+ theme.MarkdownHeadingColor = lipgloss.Color(mocha.Mauve().Hex)
64+ theme.MarkdownLinkColor = lipgloss.Color(mocha.Sky().Hex)
65+ theme.MarkdownLinkTextColor = lipgloss.Color(mocha.Pink().Hex)
66+ theme.MarkdownCodeColor = lipgloss.Color(mocha.Green().Hex)
67+ theme.MarkdownBlockQuoteColor = lipgloss.Color(mocha.Yellow().Hex)
68+ theme.MarkdownEmphColor = lipgloss.Color(mocha.Yellow().Hex)
69+ theme.MarkdownStrongColor = lipgloss.Color(mocha.Peach().Hex)
70+ theme.MarkdownHorizontalRuleColor = lipgloss.Color(mocha.Overlay0().Hex)
71+ theme.MarkdownListItemColor = lipgloss.Color(mocha.Blue().Hex)
72+ theme.MarkdownListEnumerationColor = lipgloss.Color(mocha.Sky().Hex)
73+ theme.MarkdownImageColor = lipgloss.Color(mocha.Sapphire().Hex)
74+ theme.MarkdownImageTextColor = lipgloss.Color(mocha.Pink().Hex)
75+ theme.MarkdownCodeBlockColor = lipgloss.Color(mocha.Text().Hex)
76+
77+ // Syntax highlighting colors
78+ theme.SyntaxCommentColor = lipgloss.Color(mocha.Overlay1().Hex)
79+ theme.SyntaxKeywordColor = lipgloss.Color(mocha.Pink().Hex)
80+ theme.SyntaxFunctionColor = lipgloss.Color(mocha.Green().Hex)
81+ theme.SyntaxVariableColor = lipgloss.Color(mocha.Sky().Hex)
82+ theme.SyntaxStringColor = lipgloss.Color(mocha.Yellow().Hex)
83+ theme.SyntaxNumberColor = lipgloss.Color(mocha.Teal().Hex)
84+ theme.SyntaxTypeColor = lipgloss.Color(mocha.Sky().Hex)
85+ theme.SyntaxOperatorColor = lipgloss.Color(mocha.Pink().Hex)
86+ theme.SyntaxPunctuationColor = lipgloss.Color(mocha.Text().Hex)
87+
88+ return theme
89+}
90+
91+// NewCatppuccinLatteTheme creates a new instance of the Catppuccin Latte theme.
92+func NewCatppuccinLatteTheme() *CatppuccinTheme {
93+ // Get the Catppuccin palette
1894 latte := catppuccin.Latte
1995
2096 theme := &CatppuccinTheme{}
2197
2298 // Base colors
23− theme.PrimaryColor = lipgloss.AdaptiveColor{
24− Dark: mocha.Blue().Hex,
25− Light: latte.Blue().Hex,
26− }
27− theme.SecondaryColor = lipgloss.AdaptiveColor{
28− Dark: mocha.Mauve().Hex,
29− Light: latte.Mauve().Hex,
30− }
31− theme.AccentColor = lipgloss.AdaptiveColor{
32− Dark: mocha.Peach().Hex,
33− Light: latte.Peach().Hex,
34− }
99+ theme.PrimaryColor = lipgloss.Color(latte.Blue().Hex)
100+ theme.SecondaryColor = lipgloss.Color(latte.Mauve().Hex)
101+ theme.AccentColor = lipgloss.Color(latte.Peach().Hex)
35102
36103 // Status colors
37− theme.ErrorColor = lipgloss.AdaptiveColor{
38− Dark: mocha.Red().Hex,
39− Light: latte.Red().Hex,
40− }
41− theme.WarningColor = lipgloss.AdaptiveColor{
42− Dark: mocha.Peach().Hex,
43− Light: latte.Peach().Hex,
44− }
45− theme.SuccessColor = lipgloss.AdaptiveColor{
46− Dark: mocha.Green().Hex,
47− Light: latte.Green().Hex,
48− }
49− theme.InfoColor = lipgloss.AdaptiveColor{
50− Dark: mocha.Blue().Hex,
51− Light: latte.Blue().Hex,
52− }
104+ theme.ErrorColor = lipgloss.Color(latte.Red().Hex)
105+ theme.WarningColor = lipgloss.Color(latte.Peach().Hex)
106+ theme.SuccessColor = lipgloss.Color(latte.Green().Hex)
107+ theme.InfoColor = lipgloss.Color(latte.Blue().Hex)
53108
54109 // Text colors
55− theme.TextColor = lipgloss.AdaptiveColor{
56− Dark: mocha.Text().Hex,
57− Light: latte.Text().Hex,
58− }
59− theme.TextMutedColor = lipgloss.AdaptiveColor{
60− Dark: mocha.Subtext0().Hex,
61− Light: latte.Subtext0().Hex,
62− }
63− theme.TextEmphasizedColor = lipgloss.AdaptiveColor{
64− Dark: mocha.Lavender().Hex,
65− Light: latte.Lavender().Hex,
66− }
110+ theme.TextColor = lipgloss.Color(latte.Text().Hex)
111+ theme.TextMutedColor = lipgloss.Color(latte.Subtext0().Hex)
112+ theme.TextEmphasizedColor = lipgloss.Color(latte.Lavender().Hex)
67113
68114 // Background colors
69− theme.BackgroundColor = lipgloss.AdaptiveColor{
70− Dark: "#212121", // From existing styles
71− Light: "#EEEEEE", // Light equivalent
72− }
73− theme.BackgroundSecondaryColor = lipgloss.AdaptiveColor{
74− Dark: "#2c2c2c", // From existing styles
75− Light: "#E0E0E0", // Light equivalent
76− }
77− theme.BackgroundDarkerColor = lipgloss.AdaptiveColor{
78− Dark: "#181818", // From existing styles
79− Light: "#F5F5F5", // Light equivalent
80− }
115+ theme.BackgroundColor = lipgloss.Color("#EEEEEE") // Light equivalent
116+ theme.BackgroundSecondaryColor = lipgloss.Color("#E0E0E0") // Light equivalent
117+ theme.BackgroundDarkerColor = lipgloss.Color("#F5F5F5") // Light equivalent
81118
82119 // Border colors
83− theme.BorderNormalColor = lipgloss.AdaptiveColor{
84− Dark: "#4b4c5c", // From existing styles
85− Light: "#BDBDBD", // Light equivalent
86− }
87− theme.BorderFocusedColor = lipgloss.AdaptiveColor{
88− Dark: mocha.Blue().Hex,
89− Light: latte.Blue().Hex,
90− }
91− theme.BorderDimColor = lipgloss.AdaptiveColor{
92− Dark: mocha.Surface0().Hex,
93− Light: latte.Surface0().Hex,
94− }
120+ theme.BorderNormalColor = lipgloss.Color("#BDBDBD") // Light equivalent
121+ theme.BorderFocusedColor = lipgloss.Color(latte.Blue().Hex)
122+ theme.BorderDimColor = lipgloss.Color(latte.Surface0().Hex)
95123
96124 // Diff view colors
97− theme.DiffAddedColor = lipgloss.AdaptiveColor{
98− Dark: "#478247", // From existing diff.go
99− Light: "#2E7D32", // Light equivalent
100− }
101− theme.DiffRemovedColor = lipgloss.AdaptiveColor{
102− Dark: "#7C4444", // From existing diff.go
103− Light: "#C62828", // Light equivalent
104− }
105− theme.DiffContextColor = lipgloss.AdaptiveColor{
106− Dark: "#a0a0a0", // From existing diff.go
107− Light: "#757575", // Light equivalent
108− }
109− theme.DiffHunkHeaderColor = lipgloss.AdaptiveColor{
110− Dark: "#a0a0a0", // From existing diff.go
111− Light: "#757575", // Light equivalent
112− }
113− theme.DiffHighlightAddedColor = lipgloss.AdaptiveColor{
114− Dark: "#DAFADA", // From existing diff.go
115− Light: "#A5D6A7", // Light equivalent
116− }
117− theme.DiffHighlightRemovedColor = lipgloss.AdaptiveColor{
118− Dark: "#FADADD", // From existing diff.go
119− Light: "#EF9A9A", // Light equivalent
120− }
121− theme.DiffAddedBgColor = lipgloss.AdaptiveColor{
122− Dark: "#303A30", // From existing diff.go
123− Light: "#E8F5E9", // Light equivalent
124− }
125− theme.DiffRemovedBgColor = lipgloss.AdaptiveColor{
126− Dark: "#3A3030", // From existing diff.go
127− Light: "#FFEBEE", // Light equivalent
128− }
129− theme.DiffContextBgColor = lipgloss.AdaptiveColor{
130− Dark: "#212121", // From existing diff.go
131− Light: "#F5F5F5", // Light equivalent
132− }
133− theme.DiffLineNumberColor = lipgloss.AdaptiveColor{
134− Dark: "#888888", // From existing diff.go
135− Light: "#9E9E9E", // Light equivalent
136− }
137− theme.DiffAddedLineNumberBgColor = lipgloss.AdaptiveColor{
138− Dark: "#293229", // From existing diff.go
139− Light: "#C8E6C9", // Light equivalent
140− }
141− theme.DiffRemovedLineNumberBgColor = lipgloss.AdaptiveColor{
142− Dark: "#332929", // From existing diff.go
143− Light: "#FFCDD2", // Light equivalent
144− }
125+ theme.DiffAddedColor = lipgloss.Color("#2E7D32") // Light equivalent
126+ theme.DiffRemovedColor = lipgloss.Color("#C62828") // Light equivalent
127+ theme.DiffContextColor = lipgloss.Color("#757575") // Light equivalent
128+ theme.DiffHunkHeaderColor = lipgloss.Color("#757575") // Light equivalent
129+ theme.DiffHighlightAddedColor = lipgloss.Color("#A5D6A7") // Light equivalent
130+ theme.DiffHighlightRemovedColor = lipgloss.Color("#EF9A9A") // Light equivalent
131+ theme.DiffAddedBgColor = lipgloss.Color("#E8F5E9") // Light equivalent
132+ theme.DiffRemovedBgColor = lipgloss.Color("#FFEBEE") // Light equivalent
133+ theme.DiffContextBgColor = lipgloss.Color("#F5F5F5") // Light equivalent
134+ theme.DiffLineNumberColor = lipgloss.Color("#9E9E9E") // Light equivalent
135+ theme.DiffAddedLineNumberBgColor = lipgloss.Color("#C8E6C9") // Light equivalent
136+ theme.DiffRemovedLineNumberBgColor = lipgloss.Color("#FFCDD2") // Light equivalent
145137
146138 // Markdown colors
147− theme.MarkdownTextColor = lipgloss.AdaptiveColor{
148− Dark: mocha.Text().Hex,
149− Light: latte.Text().Hex,
150− }
151− theme.MarkdownHeadingColor = lipgloss.AdaptiveColor{
152− Dark: mocha.Mauve().Hex,
153− Light: latte.Mauve().Hex,
154− }
155− theme.MarkdownLinkColor = lipgloss.AdaptiveColor{
156− Dark: mocha.Sky().Hex,
157− Light: latte.Sky().Hex,
158− }
159− theme.MarkdownLinkTextColor = lipgloss.AdaptiveColor{
160− Dark: mocha.Pink().Hex,
161− Light: latte.Pink().Hex,
162− }
163− theme.MarkdownCodeColor = lipgloss.AdaptiveColor{
164− Dark: mocha.Green().Hex,
165− Light: latte.Green().Hex,
166− }
167− theme.MarkdownBlockQuoteColor = lipgloss.AdaptiveColor{
168− Dark: mocha.Yellow().Hex,
169− Light: latte.Yellow().Hex,
170− }
171− theme.MarkdownEmphColor = lipgloss.AdaptiveColor{
172− Dark: mocha.Yellow().Hex,
173− Light: latte.Yellow().Hex,
174− }
175− theme.MarkdownStrongColor = lipgloss.AdaptiveColor{
176− Dark: mocha.Peach().Hex,
177− Light: latte.Peach().Hex,
178− }
179− theme.MarkdownHorizontalRuleColor = lipgloss.AdaptiveColor{
180− Dark: mocha.Overlay0().Hex,
181− Light: latte.Overlay0().Hex,
182− }
183− theme.MarkdownListItemColor = lipgloss.AdaptiveColor{
184− Dark: mocha.Blue().Hex,
185− Light: latte.Blue().Hex,
186− }
187− theme.MarkdownListEnumerationColor = lipgloss.AdaptiveColor{
188− Dark: mocha.Sky().Hex,
189− Light: latte.Sky().Hex,
190− }
191− theme.MarkdownImageColor = lipgloss.AdaptiveColor{
192− Dark: mocha.Sapphire().Hex,
193− Light: latte.Sapphire().Hex,
194− }
195− theme.MarkdownImageTextColor = lipgloss.AdaptiveColor{
196− Dark: mocha.Pink().Hex,
197− Light: latte.Pink().Hex,
198− }
199− theme.MarkdownCodeBlockColor = lipgloss.AdaptiveColor{
200− Dark: mocha.Text().Hex,
201− Light: latte.Text().Hex,
202− }
139+ theme.MarkdownTextColor = lipgloss.Color(latte.Text().Hex)
140+ theme.MarkdownHeadingColor = lipgloss.Color(latte.Mauve().Hex)
141+ theme.MarkdownLinkColor = lipgloss.Color(latte.Sky().Hex)
142+ theme.MarkdownLinkTextColor = lipgloss.Color(latte.Pink().Hex)
143+ theme.MarkdownCodeColor = lipgloss.Color(latte.Green().Hex)
144+ theme.MarkdownBlockQuoteColor = lipgloss.Color(latte.Yellow().Hex)
145+ theme.MarkdownEmphColor = lipgloss.Color(latte.Yellow().Hex)
146+ theme.MarkdownStrongColor = lipgloss.Color(latte.Peach().Hex)
147+ theme.MarkdownHorizontalRuleColor = lipgloss.Color(latte.Overlay0().Hex)
148+ theme.MarkdownListItemColor = lipgloss.Color(latte.Blue().Hex)
149+ theme.MarkdownListEnumerationColor = lipgloss.Color(latte.Sky().Hex)
150+ theme.MarkdownImageColor = lipgloss.Color(latte.Sapphire().Hex)
151+ theme.MarkdownImageTextColor = lipgloss.Color(latte.Pink().Hex)
152+ theme.MarkdownCodeBlockColor = lipgloss.Color(latte.Text().Hex)
203153
204154 // Syntax highlighting colors
205− theme.SyntaxCommentColor = lipgloss.AdaptiveColor{
206− Dark: mocha.Overlay1().Hex,
207− Light: latte.Overlay1().Hex,
208− }
209− theme.SyntaxKeywordColor = lipgloss.AdaptiveColor{
210− Dark: mocha.Pink().Hex,
211− Light: latte.Pink().Hex,
212− }
213− theme.SyntaxFunctionColor = lipgloss.AdaptiveColor{
214− Dark: mocha.Green().Hex,
215− Light: latte.Green().Hex,
216− }
217− theme.SyntaxVariableColor = lipgloss.AdaptiveColor{
218− Dark: mocha.Sky().Hex,
219− Light: latte.Sky().Hex,
220− }
221− theme.SyntaxStringColor = lipgloss.AdaptiveColor{
222− Dark: mocha.Yellow().Hex,
223− Light: latte.Yellow().Hex,
224− }
225− theme.SyntaxNumberColor = lipgloss.AdaptiveColor{
226− Dark: mocha.Teal().Hex,
227− Light: latte.Teal().Hex,
228− }
229− theme.SyntaxTypeColor = lipgloss.AdaptiveColor{
230− Dark: mocha.Sky().Hex,
231− Light: latte.Sky().Hex,
232− }
233− theme.SyntaxOperatorColor = lipgloss.AdaptiveColor{
234− Dark: mocha.Pink().Hex,
235− Light: latte.Pink().Hex,
236− }
237− theme.SyntaxPunctuationColor = lipgloss.AdaptiveColor{
238− Dark: mocha.Text().Hex,
239− Light: latte.Text().Hex,
240− }
155+ theme.SyntaxCommentColor = lipgloss.Color(latte.Overlay1().Hex)
156+ theme.SyntaxKeywordColor = lipgloss.Color(latte.Pink().Hex)
157+ theme.SyntaxFunctionColor = lipgloss.Color(latte.Green().Hex)
158+ theme.SyntaxVariableColor = lipgloss.Color(latte.Sky().Hex)
159+ theme.SyntaxStringColor = lipgloss.Color(latte.Yellow().Hex)
160+ theme.SyntaxNumberColor = lipgloss.Color(latte.Teal().Hex)
161+ theme.SyntaxTypeColor = lipgloss.Color(latte.Sky().Hex)
162+ theme.SyntaxOperatorColor = lipgloss.Color(latte.Pink().Hex)
163+ theme.SyntaxPunctuationColor = lipgloss.Color(latte.Text().Hex)
241164
242165 return theme
243166}
244167
245168func init() {
246− // Register the Catppuccin theme with the theme manager
247− RegisterTheme("catppuccin", NewCatppuccinTheme())
248−}
169+ // Register the Catppuccin themes with the theme manager
170+ RegisterTheme("catppuccin-mocha", NewCatppuccinMochaTheme())
171+ RegisterTheme("catppuccin-latte", NewCatppuccinLatteTheme())
172+}