summaryrefslogtreecommitdiff
path: root/.config/emacs/mango-theme.el
blob: 72a76f94a603bb06a7d4153e721071b9b5592644 (plain) (blame)
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
;;; mango-theme.el --- Just your average dark theme  -*- lexical-binding: t; -*-

(deftheme mango
  "Mildly dark, dark theme.
Your average not-so-dark dark theme, because none of the other options
were exactly to my liking.  It’s about time I had a theme to call my
own.")

(defconst mango-theme-colors-alist
  '((foreground       . ("#C5C8C6" "color-251" "white"))
    (background       . ("#2B303B" "color-236" "black"))
    (background-cool  . ("#363C4A" "color-237" "black"))
    (background-dark  . ("#1D2635" "color-234" "black"))
    (background-faint . ("#414859" "color-238" "brightblack"))
    (middleground     . ("#4F5561" "color-239" "brightblack"))
    (disabled         . ("#999999" "color-246" "brightblack"))
    (celestial-blue   . ("#569CD6" "color-74"  "brightblue"))
    (dark-red         . ("#841A11" "color-88"  "red"))
    (khaki            . ("#F0E68C" "color-228" "yellow"))
    (lime             . ("#B8F182" "color-156" "green"))
    (magenta          . ("#ED97F5" "color-213" "magenta"))
    (pale-azure       . ("#9CDCFE" "color-117" "cyan"))
    (red              . ("#E60026" "color-160" "brightred"))
    (salmon           . ("#F1B282" "color-216" "brightyellow"))
    (violet           . ("#E57AE5" "color-176" "brightmagenta")))
  "The color palette used throughout `mango-theme'.
Each color is mapped to a list of colors of the form
(GUI-HEX 256-COLOR 16-COLOR) for use in true-color, 256-color, and
16-color modes.")

(defsubst mango-theme-color (name &optional display)
  "Get the color value of NAME for the given DISPLAY.
DISPLAY can be 'gui, '256, or '16."
  (let ((colors (alist-get name mango-theme-colors-alist)))
    (pcase display
      ('gui (nth 0 colors))
      ('256 (nth 1 colors))
      ('16  (nth 2 colors))
      (_    (nth 0 colors)))))

(custom-theme-set-faces
 'mango

 ;; Standard Stuff
 `(default
   ((((type graphic tty) (min-colors 16777216))
     (:foreground ,(mango-theme-color 'foreground 'gui)
      :background ,(mango-theme-color 'background 'gui)))
    (((type tty) (min-colors 256))
     (:foreground ,(mango-theme-color 'foreground '256)
      :background ,(mango-theme-color 'background '256)))
    (((type tty))
     (:foreground ,(mango-theme-color 'foreground '16)
      :background ,(mango-theme-color 'background '16)))))
 `(fringe
   ((t (:inherit default))))

 ;; Lines
 `(hl-line
   ((((type graphic tty) (min-colors 16777216))
     (:background ,(mango-theme-color 'background-faint 'gui)))
    (((type tty) (min-colors 256))
     (:background ,(mango-theme-color 'background-faint '256)))
    (((type tty))
     (:background ,(mango-theme-color 'background-faint '16)))))
 `(region
   ((((type graphic tty) (min-colors 16777216))
     (:background ,(mango-theme-color 'middleground 'gui)))
    (((type tty) (min-colors 256))
     (:background ,(mango-theme-color 'middleground '256)))
    (((type tty))
     (:background ,(mango-theme-color 'middleground '16)))))
 `(header-line
   ((((type graphic tty) (min-colors 16777216))
     (:background ,(mango-theme-color 'middleground 'gui)))
    (((type tty) (min-colors 256))
     (:background ,(mango-theme-color 'middleground '256)))
    (((type tty))
     (:background ,(mango-theme-color 'middleground '16)))))
 `(mode-line-active
   ((t (:inherit header-line))))
 `(mode-line-inactive
   ((((type graphic tty) (min-colors 16777216))
     (:background ,(mango-theme-color 'background-cool 'gui) :weight light))
    (((type tty) (min-colors 256))
     (:background ,(mango-theme-color 'background-cool '256) :weight light))
    (((type tty))
     (:background ,(mango-theme-color 'background-cool '16) :weight light))))
 `(window-divider
   ((((type graphic tty) (min-colors 16777216))
     (:foreground ,(mango-theme-color 'background-cool 'gui)))
    (((type tty) (min-colors 256))
     (:foreground ,(mango-theme-color 'background-cool '256)))
    (((type tty))
     (:foreground ,(mango-theme-color 'background-cool '16)))))
 `(window-divider-first-pixel
   ((((type graphic tty) (min-colors 16777216))
     (:foreground ,(mango-theme-color 'background-cool 'gui)))
    (((type tty) (min-colors 256))
     (:foreground ,(mango-theme-color 'background-cool '256)))
    (((type tty))
     (:foreground ,(mango-theme-color 'background-cool '16)))))
 `(window-divider-last-pixel
   ((((type graphic tty) (min-colors 16777216))
     (:foreground ,(mango-theme-color 'background-cool 'gui)))
    (((type tty) (min-colors 256))
     (:foreground ,(mango-theme-color 'background-cool '256)))
    (((type tty))
     (:foreground ,(mango-theme-color 'background-cool '16)))))

 ;; Line Numbers
 `(line-number
   ((((type graphic tty) (min-colors 16777216))
     (:foreground ,(mango-theme-color 'background-faint 'gui)
      :background ,(mango-theme-color 'background 'gui)))
    (((type tty) (min-colors 256))
     (:foreground ,(mango-theme-color 'background-faint '256)
      :background ,(mango-theme-color 'background '256)))
    (((type tty))
     (:foreground ,(mango-theme-color 'background-faint '16)
      :background ,(mango-theme-color 'background '16)))))
 `(line-number-current-line
   ((((type graphic tty) (min-colors 16777216))
     (:foreground ,(mango-theme-color 'salmon 'gui)
      :background ,(mango-theme-color 'background 'gui) :weight bold))
    (((type tty) (min-colors 256))
     (:foreground ,(mango-theme-color 'salmon '256)
      :background ,(mango-theme-color 'background '256) :weight bold))
    (((type tty))
     (:foreground ,(mango-theme-color 'salmon '16)
      :background ,(mango-theme-color 'background '16) :weight bold))))

 ;; Documentation
 `(font-lock-comment-face
   ((((type graphic tty) (min-colors 16777216))
     (:foreground ,(mango-theme-color 'khaki 'gui) :weight semi-bold))
    (((type tty) (min-colors 256))
     (:foreground ,(mango-theme-color 'khaki '256) :weight semi-bold))
    (((type tty))
     (:foreground ,(mango-theme-color 'khaki '16) :weight semi-bold))))
 `(font-lock-doc-face
   ((((type graphic tty) (min-colors 16777216))
     (:foreground ,(mango-theme-color 'disabled 'gui)))
    (((type tty) (min-colors 256))
     (:foreground ,(mango-theme-color 'disabled '256)))
    (((type tty))
     (:foreground ,(mango-theme-color 'disabled '16)))))

 ;; Modeline
 `(mm-modeline-overwrite-face ((t (:weight bold))))
 `(mm-modeline-readonly-face ((t (:weight bold))))
 `(mm-modeline-buffer-name-face ((t (:inherit font-lock-constant-face))))
 `(mm-modeline-buffer-modified-face ((t (:inherit shadow))))
 `(mm-modeline-major-mode-name-face ((t (:weight bold))))
 `(mm-modeline-major-mode-symbol-face ((t (:inherit shadow))))
 `(mm-modeline-git-branch-face ((t (:inherit font-lock-constant-face))))
 `(mm-modeline-narrow-face
   ((((type graphic tty) (min-colors 16777216))
     (:background ,(mango-theme-color 'dark-red 'gui) :box ,(mango-theme-color 'dark-red 'gui) :weight bold))
    (((type tty) (min-colors 256))
     (:background ,(mango-theme-color 'dark-red '256) :box ,(mango-theme-color 'dark-red '256) :weight bold))
    (((type tty))
     (:background ,(mango-theme-color 'dark-red '16) :box ,(mango-theme-color 'dark-red '16) :weight bold))))

 ;; Core Language
 `(font-lock-builtin-face ((t (:inherit font-lock-preprocessor-face))))
 `(font-lock-keyword-face
   ((((type graphic tty) (min-colors 16777216))
     (:foreground ,(mango-theme-color 'violet 'gui)))
    (((type tty) (min-colors 256))
     (:foreground ,(mango-theme-color 'violet '256)))
    (((type tty))
     (:foreground ,(mango-theme-color 'violet '16)))))
 `(font-lock-type-face
   ((((type graphic tty) (min-colors 16777216))
     (:foreground ,(mango-theme-color 'celestial-blue 'gui)))
    (((type tty) (min-colors 256))
     (:foreground ,(mango-theme-color 'celestial-blue '256)))
    (((type tty))
     (:foreground ,(mango-theme-color 'celestial-blue '16)))))

 ;; Function-likes
 `(font-lock-function-name-face
   ((((type graphic tty) (min-colors 16777216))
     (:foreground ,(mango-theme-color 'khaki 'gui)))
    (((type tty) (min-colors 256))
     (:foreground ,(mango-theme-color 'khaki '256)))
    (((type tty))
     (:foreground ,(mango-theme-color 'khaki '16)))))
 `(font-lock-preprocessor-face
   ((((type graphic tty) (min-colors 16777216))
     (:foreground ,(mango-theme-color 'magenta 'gui) :weight bold))
    (((type tty) (min-colors 256))
     (:foreground ,(mango-theme-color 'magenta '256) :weight bold))
    (((type tty))
     (:foreground ,(mango-theme-color 'magenta '16) :weight bold))))

 ;; Variables
 `(font-lock-constant-face ((t (:inherit font-lock-variable-name-face :weight bold))))
 `(font-lock-variable-name-face
   ((((type graphic tty) (min-colors 16777216))
     (:foreground ,(mango-theme-color 'pale-azure 'gui)))
    (((type tty) (min-colors 256))
     (:foreground ,(mango-theme-color 'pale-azure '256)))
    (((type tty))
     (:foreground ,(mango-theme-color 'pale-azure '16)))))

 ;; Other literals
 `(help-key-binding ((t (:inherit font-lock-constant-face))))
 `(font-lock-string-face
   ((((type graphic tty) (min-colors 16777216))
     (:foreground ,(mango-theme-color 'salmon 'gui)))
    (((type tty) (min-colors 256))
     (:foreground ,(mango-theme-color 'salmon '256)))
    (((type tty))
     (:foreground ,(mango-theme-color 'salmon '16)))))
 `(font-lock-number-face
   ((((type graphic tty) (min-colors 16777216))
     (:foreground ,(mango-theme-color 'salmon 'gui)))
    (((type tty) (min-colors 256))
     (:foreground ,(mango-theme-color 'salmon '256)))
    (((type tty))
     (:foreground ,(mango-theme-color 'salmon '16)))))

 ;; Org Mode
 `(org-quote ((t (:inherit org-block :slant italic))))
 `(org-code
   ((((type graphic tty) (min-colors 16777216))
     (:foreground ,(mango-theme-color 'salmon 'gui)))
    (((type tty) (min-colors 256))
     (:foreground ,(mango-theme-color 'salmon '256)))
    (((type tty))
     (:foreground ,(mango-theme-color 'salmon '16)))))
 `(org-verbatim
   ((((type graphic tty) (min-colors 16777216))
     (:foreground ,(mango-theme-color 'lime 'gui)))
    (((type tty) (min-colors 256))
     (:foreground ,(mango-theme-color 'lime '256)))
    (((type tty))
     (:foreground ,(mango-theme-color 'lime '16)))))
 `(org-block
   ((((type graphic tty) (min-colors 16777216))
     (:background ,(mango-theme-color 'background-cool 'gui)))
    (((type tty) (min-colors 256))
     (:background ,(mango-theme-color 'background-cool '256)))
    (((type tty))
     (:background ,(mango-theme-color 'background-cool '16)))))
 `(org-hide
   ((((type graphic tty) (min-colors 16777216))
     (:foreground ,(mango-theme-color 'background 'gui)))
    (((type tty) (min-colors 256))
     (:foreground ,(mango-theme-color 'background '256)))
    (((type tty))
     (:foreground ,(mango-theme-color 'background '16)))))

 ;; Info Page
 `(Info-quoted ((t (:inherit default))))

 ;; Magit
 `(magit-diff-context-highlight ((t (:inherit hl-line))))
 `(magit-section-highlight ((t (:inherit hl-line))))
 `(magit-diff-hunk-heading
   ((((type graphic tty) (min-colors 16777216))
     (:background ,(mango-theme-color 'background-cool 'gui)))
    (((type tty) (min-colors 256))
     (:background ,(mango-theme-color 'background-cool '256)))
    (((type tty))
     (:background ,(mango-theme-color 'background-cool '16)))))
 `(magit-diff-hunk-heading-highlight
   ((((type graphic tty) (min-colors 16777216))
     (:background ,(mango-theme-color 'middleground 'gui)))
    (((type tty) (min-colors 256))
     (:background ,(mango-theme-color 'middleground '256)))
    (((type tty))
     (:background ,(mango-theme-color 'middleground '16)))))
 `(git-commit-summary
   ((((type graphic tty) (min-colors 16777216))
     (:foreground ,(mango-theme-color 'khaki 'gui)))
    (((type tty) (min-colors 256))
     (:foreground ,(mango-theme-color 'khaki '256)))
    (((type tty))
     (:foreground ,(mango-theme-color 'khaki '16)))))
 `(git-commit-overlong-summary
   ((((type graphic tty) (min-colors 16777216))
     (:foreground ,(mango-theme-color 'foreground 'gui)
      :background ,(mango-theme-color 'red 'gui) :weight bold))
    (((type tty) (min-colors 256))
     (:foreground ,(mango-theme-color 'foreground '256)
      :background ,(mango-theme-color 'red '256) :weight bold))
    (((type tty))
     (:foreground ,(mango-theme-color 'foreground '16)
      :background ,(mango-theme-color 'red '16) :weight bold))))

 ;; Vertico
 `(vertico-current ((t (:inherit hl-line))))

 ;; Marginalia
 `(mm-diffstat-counter-added ((t (:foreground "green" :weight bold))))
 `(mm-diffstat-counter-removed ((t (:foreground "red" :weight bold))))
 `(marginalia-documentation
   ((((type graphic tty) (min-colors 16777216))
     (:foreground ,(mango-theme-color 'disabled 'gui) :underline nil))
    (((type tty) (min-colors 256))
     (:foreground ,(mango-theme-color 'disabled '256) :underline nil))
    (((type tty))
     (:foreground ,(mango-theme-color 'disabled '16) :underline nil))))

 ;; Tempel
 `(tempel-default
   ((((type graphic tty) (min-colors 16777216))
     (:slant italic :background ,(mango-theme-color 'middleground 'gui)))
    (((type tty) (min-colors 256))
     (:slant italic :background ,(mango-theme-color 'middleground '256)))
    (((type tty))
     (:slant italic :background ,(mango-theme-color 'middleground '16)))))
 `(tempel-field
   ((((type graphic tty) (min-colors 16777216))
     (:slant italic :background ,(mango-theme-color 'middleground 'gui)))
    (((type tty) (min-colors 256))
     (:slant italic :background ,(mango-theme-color 'middleground '256)))
    (((type tty))
     (:slant italic :background ,(mango-theme-color 'middleground '16)))))
 `(tempel-form
   ((((type graphic tty) (min-colors 16777216))
     (:slant italic :background ,(mango-theme-color 'middleground 'gui)))
    (((type tty) (min-colors 256))
     (:slant italic :background ,(mango-theme-color 'middleground '256)))
    (((type tty))
     (:slant italic :background ,(mango-theme-color 'middleground '16))))))

(provide-theme 'mango)