4 "github.com/charmbracelet/lipgloss"
7// OpenCodeTheme implements the Theme interface with OpenCode brand colors.
8// It provides both dark and light variants.
9type OpenCodeTheme struct {
13// NewOpenCodeTheme creates a new instance of the OpenCode theme.
14func NewOpenCodeTheme() *OpenCodeTheme {
15 // OpenCode color palette
17 darkBackground := "#212121"
18 darkCurrentLine := "#252525"
19 darkSelection := "#303030"
20 darkForeground := "#e0e0e0"
21 darkComment := "#6a6a6a"
22 darkPrimary := "#fab283" // Primary orange/gold
23 darkSecondary := "#5c9cf5" // Secondary blue
24 darkAccent := "#9d7cd8" // Accent purple
25 darkRed := "#e06c75" // Error red
26 darkOrange := "#f5a742" // Warning orange
27 darkGreen := "#7fd88f" // Success green
28 darkCyan := "#56b6c2" // Info cyan
29 darkYellow := "#e5c07b" // Emphasized text
30 darkBorder := "#4b4c5c" // Border color
33 lightBackground := "#f8f8f8"
34 lightCurrentLine := "#f0f0f0"
35 lightSelection := "#e5e5e6"
36 lightForeground := "#2a2a2a"
37 lightComment := "#8a8a8a"
38 lightPrimary := "#3b7dd8" // Primary blue
39 lightSecondary := "#7b5bb6" // Secondary purple
40 lightAccent := "#d68c27" // Accent orange/gold
41 lightRed := "#d1383d" // Error red
42 lightOrange := "#d68c27" // Warning orange
43 lightGreen := "#3d9a57" // Success green
44 lightCyan := "#318795" // Info cyan
45 lightYellow := "#b0851f" // Emphasized text
46 lightBorder := "#d3d3d3" // Border color
48 theme := &OpenCodeTheme{}
51 theme.PrimaryColor = lipgloss.AdaptiveColor{
55 theme.SecondaryColor = lipgloss.AdaptiveColor{
57 Light: lightSecondary,
59 theme.AccentColor = lipgloss.AdaptiveColor{
65 theme.ErrorColor = lipgloss.AdaptiveColor{
69 theme.WarningColor = lipgloss.AdaptiveColor{
73 theme.SuccessColor = lipgloss.AdaptiveColor{
77 theme.InfoColor = lipgloss.AdaptiveColor{
83 theme.TextColor = lipgloss.AdaptiveColor{
85 Light: lightForeground,
87 theme.TextMutedColor = lipgloss.AdaptiveColor{
91 theme.TextEmphasizedColor = lipgloss.AdaptiveColor{
97 theme.BackgroundColor = lipgloss.AdaptiveColor{
99 Light: lightBackground,
101 theme.BackgroundSecondaryColor = lipgloss.AdaptiveColor{
102 Dark: darkCurrentLine,
103 Light: lightCurrentLine,
105 theme.BackgroundDarkerColor = lipgloss.AdaptiveColor{
106 Dark: "#121212", // Slightly darker than background
107 Light: "#ffffff", // Slightly lighter than background
111 theme.BorderNormalColor = lipgloss.AdaptiveColor{
115 theme.BorderFocusedColor = lipgloss.AdaptiveColor{
119 theme.BorderDimColor = lipgloss.AdaptiveColor{
121 Light: lightSelection,
125 theme.DiffAddedColor = lipgloss.AdaptiveColor{
129 theme.DiffRemovedColor = lipgloss.AdaptiveColor{
133 theme.DiffContextColor = lipgloss.AdaptiveColor{
137 theme.DiffHunkHeaderColor = lipgloss.AdaptiveColor{
141 theme.DiffHighlightAddedColor = lipgloss.AdaptiveColor{
145 theme.DiffHighlightRemovedColor = lipgloss.AdaptiveColor{
149 theme.DiffAddedBgColor = lipgloss.AdaptiveColor{
153 theme.DiffRemovedBgColor = lipgloss.AdaptiveColor{
157 theme.DiffContextBgColor = lipgloss.AdaptiveColor{
158 Dark: darkBackground,
159 Light: lightBackground,
161 theme.DiffLineNumberColor = lipgloss.AdaptiveColor{
165 theme.DiffAddedLineNumberBgColor = lipgloss.AdaptiveColor{
169 theme.DiffRemovedLineNumberBgColor = lipgloss.AdaptiveColor{
175 theme.MarkdownTextColor = lipgloss.AdaptiveColor{
176 Dark: darkForeground,
177 Light: lightForeground,
179 theme.MarkdownHeadingColor = lipgloss.AdaptiveColor{
181 Light: lightSecondary,
183 theme.MarkdownLinkColor = lipgloss.AdaptiveColor{
187 theme.MarkdownLinkTextColor = lipgloss.AdaptiveColor{
191 theme.MarkdownCodeColor = lipgloss.AdaptiveColor{
195 theme.MarkdownBlockQuoteColor = lipgloss.AdaptiveColor{
199 theme.MarkdownEmphColor = lipgloss.AdaptiveColor{
203 theme.MarkdownStrongColor = lipgloss.AdaptiveColor{
207 theme.MarkdownHorizontalRuleColor = lipgloss.AdaptiveColor{
211 theme.MarkdownListItemColor = lipgloss.AdaptiveColor{
215 theme.MarkdownListEnumerationColor = lipgloss.AdaptiveColor{
219 theme.MarkdownImageColor = lipgloss.AdaptiveColor{
223 theme.MarkdownImageTextColor = lipgloss.AdaptiveColor{
227 theme.MarkdownCodeBlockColor = lipgloss.AdaptiveColor{
228 Dark: darkForeground,
229 Light: lightForeground,
232 // Syntax highlighting colors
233 theme.SyntaxCommentColor = lipgloss.AdaptiveColor{
237 theme.SyntaxKeywordColor = lipgloss.AdaptiveColor{
239 Light: lightSecondary,
241 theme.SyntaxFunctionColor = lipgloss.AdaptiveColor{
245 theme.SyntaxVariableColor = lipgloss.AdaptiveColor{
249 theme.SyntaxStringColor = lipgloss.AdaptiveColor{
253 theme.SyntaxNumberColor = lipgloss.AdaptiveColor{
257 theme.SyntaxTypeColor = lipgloss.AdaptiveColor{
261 theme.SyntaxOperatorColor = lipgloss.AdaptiveColor{
265 theme.SyntaxPunctuationColor = lipgloss.AdaptiveColor{
266 Dark: darkForeground,
267 Light: lightForeground,
274 // Register the OpenCode theme with the theme manager
275 RegisterTheme("opencode", NewOpenCodeTheme())
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list