-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththeme.go
More file actions
154 lines (122 loc) · 3.46 KB
/
Copy paththeme.go
File metadata and controls
154 lines (122 loc) · 3.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
package main
// Theme defines all colors used in the application.
type Theme struct {
// Cursor and selection
CursorBg string // cursor background
CursorFg string // cursor foreground
SelectMark string // selection mark color
// Directories
DirFg string // directory name color
// Git status
GitModified string
GitAdded string
GitDeleted string
GitRenamed string
GitUntracked string
GitConflicted string
// Status bar
StatusBg string // status bar background
StatusFg string // status bar foreground
StatusGitBg string // git info background
StatusGitFg string // git info foreground
StatusSortBg string // sort mode background
StatusSortFg string // sort mode foreground
StatusGG string // gg pending indicator
// Messages
MsgSuccess string // success message
MsgError string // error message
// Text
TextDim string // dimmed/description text
// Help
HelpBorder string
// Filter highlight
FilterMatch string // matching characters in filter
// Diff
DiffHeader string // @@ lines and diff headers
DiffAdd string // + lines
DiffDel string // - lines
// Preview
PreviewTitle string
PreviewLoad string // loading indicator
// Confirm dialog
ConfirmBg string
ConfirmFg string
}
// DefaultTheme returns the default dark theme.
func DefaultTheme() Theme {
return Theme{
CursorBg: "62",
CursorFg: "15",
SelectMark: "10",
DirFg: "12",
GitModified: "11",
GitAdded: "10",
GitDeleted: "9",
GitRenamed: "14",
GitUntracked: "8",
GitConflicted: "9",
StatusBg: "240",
StatusFg: "15",
StatusGitBg: "22",
StatusGitFg: "15",
StatusSortBg: "240",
StatusSortFg: "15",
StatusGG: "11",
MsgSuccess: "10",
MsgError: "9",
TextDim: "240",
HelpBorder: "12",
FilterMatch: "11",
DiffHeader: "14",
DiffAdd: "10",
DiffDel: "9",
PreviewTitle: "14",
PreviewLoad: "11",
ConfirmBg: "1",
ConfirmFg: "15",
}
}
// CatppuccinMochaTheme returns a Catppuccin Mocha inspired theme.
// Colors are approximated to ANSI 256 palette.
func CatppuccinMochaTheme() Theme {
return Theme{
CursorBg: "236", // Surface0 #313244
CursorFg: "252", // Text #cdd6f4
SelectMark: "114", // Green #a6e3a1
DirFg: "111", // Blue #89b4fa
GitModified: "223", // Yellow #f9e2af
GitAdded: "114", // Green #a6e3a1
GitDeleted: "211", // Red #f38ba8
GitRenamed: "80", // Teal #94e2d5
GitUntracked: "249", // Subtext1 #bac2de
GitConflicted: "211", // Red #f38ba8
StatusBg: "236", // Surface0 #313244
StatusFg: "252", // Text #cdd6f4
StatusGitBg: "238", // Surface2 #585b70
StatusGitFg: "252", // Text #cdd6f4
StatusSortBg: "236", // Surface0 #313244
StatusSortFg: "252", // Text #cdd6f4
StatusGG: "218", // Pink #f5c2e7
MsgSuccess: "114", // Green #a6e3a1
MsgError: "211", // Red #f38ba8
TextDim: "243", // Overlay1 #7f849c
HelpBorder: "147", // Lavender #b4befe
FilterMatch: "223", // Yellow #f9e2af
DiffHeader: "141", // Mauve #cba6f7
DiffAdd: "114", // Green #a6e3a1
DiffDel: "211", // Red #f38ba8
PreviewTitle: "80", // Teal #94e2d5
PreviewLoad: "218", // Pink #f5c2e7
ConfirmBg: "236", // Surface0 #313244
ConfirmFg: "252", // Text #cdd6f4
}
}
// ThemeFromConfig returns a theme based on the config name.
func ThemeFromConfig(name string) Theme {
switch name {
case "catppuccin", "catppuccin-mocha":
return CatppuccinMochaTheme()
default:
return DefaultTheme()
}
}