aboutsummaryrefslogtreecommitdiff
path: root/gui/conf/metakr.org
blob: 1902595cc3516018ae110309b57bcaba76bfcf0f (plain)
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
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
#+TITLE: Metakr

This file describes a basic Emacs version of my custom Vim color theme _akr_.
For quick iteration all colors are stored in a table. 

* Tangle scaffold
#+BEGIN_SRC emacs-lisp :tangle ./akr-theme.el :noweb yes
(deftheme akr "A theme of my own making.")

<<theme-generator(palette=akr-palette, theme-name="akr")>>

(when (and (boundp 'custom-theme-load-path)
           load-file-name)
  (add-to-list 'custom-theme-load-path
               (file-name-as-directory
                (file-name-directory load-file-name))))

(provide-theme 'akr)
(provide 'akr-theme)
#+END_SRC
* Colors
#+NAME: akr-palette
| Label                   | Color   |
| fg                      | #F2F2F2 |
| bg                      | #161616 |
| emph                    | #eeeeee |
| sep                     | #444444 |
| hlt                     | #000000 |
| bg-hlt                  | #8C3346 |
| muted                   | #F2F2F2 |
| meta                    | #ede7dd |
| link                    | #AADB0F |
| link-underline          | #AADB0F |
| header                  | #AADB0F |
| button                  | #aaaaaa |
| glyph                   | #F7FFD1 |
| cursor                  | #AADB0F |
| paren-match-fg          | #161616 |
| paren-match-bg          | #AADB0F |
| search-fg               | #161616 |
| search-bg               | #909636 |
| search-fail-bg          | #8C3346 |
| tooltip-fg              | #161616 |
| tooltip-bg              | #909636 |
| shadow                  | #9E9E9E |
| secondary-bg            | #080808 |
| trailing-bg             | #8C3346 |
| lazy-hlt-fg             | #000000 |
| lazy-hlt-bg             | #FFFFFF |
| evil-rep-fg             | #F2F2F2 |
| evil-rep-bg             | #161616 |
| header-line-bg          | #080808 |
| mode-line-fg            | #909636 |
| mode-line-hlt           | #000000 |
| mode-line-inactive      | #9E9E9E |
| error                   | #8C3346 |
| builtin                 | #AADB0F |
| string                  | #AADB0F |
| function-name           | #F2F2F2 |
| keyword                 | #AADB0F |
| constant                | #F2F2F2 |
| type                    | #AADB0F |
| variable                | #F2F2F2 |
| preprocessor            | #F2F2F2 |
| org-meta                | #E4E093 |
| org-document-info       | #E4E093 |
| org-table               | #080808 |
| org-quote-fg            | #F2F2F2 |
| org-quote-bg            | #080808 |
| org-date                | #c6b6ad |
| org-title               | #AADB0F |
| org-ellipsis            | #AADB0F |
| org-title-underline     | #F2F2F2 |
| org-checkbox            | #999999 |
| org-scheduled           | #dddddd |
| org-scheduled-today     | #FFFFFF |
| org-done                | #909636 |
| org-todo                | #D80F32 |
| org-tag                 | #E4E093 |
| org-block-line          | #161616 |
| org-block-bg            | #080808 |
| org-agenda-structure-fg | #aaaaaa |
| org-agenda-structure-bg | #080808 |
| org-agenda-today-fg     | #dddddd |
| org-agenda-today-bg     | #000000 |
| org-special-keyword     | #777777 |
| org-sched-prev          | #F2F2F2 |
| org-deadline            | #F2F2F2 |
| org-agenda-done         | #909636 |
| eshell-prompt           | #AADB0F |
| helm-header-fg          | #909636 |
| helm-header-bg          | #161616 |
| helm-source-header-fg   | #161616 |
| helm-source-header-bg   | #909636 |
| whitespace-tab          | #222222 |

* Structure
#+NAME: structure
#+BEGIN_SRC emacs-lisp
;; Basics
'((default
    :background @bg
    :foreground @fg)
  (italic
   :foreground @emph
   :slant italic)
  (highlight
   :background @hlt
   :overline nil)
  (region
   :background @bg-hlt)
  (fringe
   :background @bg)
  (button
   :inherit default
   :foreground @button)
  (escape-glyph
   :foreground @glyph)
  (link
   :underline (:color @link-underline :style line)
   :foreground @link)
  (link-visited
   :inherit link)
  (cursor
   :background @cursor)
  (show-paren-match
   :background @paren-match-fg
   :foreground @paren-match-bg)
  (isearch
   :foreground @search-fg
   :background @search-bg)
  (isearch-fail
   :background @search-fail-bg)
  (query-replace
   :inherit isearch)
  (tooltip
   :inherit default
   :foreground @tooltip-fg
   :background @tooltip-bg)
  (shadow
   :foreground @shadow)
  (secondary-selection
   :background @secondary-bg)
  (trailing-whitespace
   :background @trailing-bg)
  (lazy-highlight
   :foreground @lazy-hlt-fg
   :background @lazy-hlt-bg)
  (next-error
   :inherit region)
  (window-divider
   :background @sep
   :foreground @sep)
  (vertical-border
   :background @sep
   :foreground @sep)

;; Evil
  (evil-ex-substitute-replacement
   :foreground @evil-rep-fg
   :background @evil-rep-bg
   :underline nil)

;; Minibuffer
  (minibuffer-prompt
   :inherit fixed-pitch
   :weight bold
   :foreground @meta)

;; Header Line
  (header-line
   :overline nil
   :background @header-line-bg
   :box (:line-width 3 :color @header-line-bg)
   :underline @sep
   :inherit mode-line)

 ;; Mode Line
  (mode-line
   :inherit fixed-pitch
   :foreground @mode-line-fg
   :background @bg
   :overline @sep)
  (mode-line-buffer-id
   :weight bold)
  (mode-line-emphasis
   :weight bold)
  (mode-line-highlight
   :background @mode-line-hlt)
  (mode-line-inactive
   :inherit mode-line
   :background @bg
   :foreground @mode-line-inactive
   :overline @sep)

;; Syntax
  (error
   :foreground @error
   :inherit fixed-pitch)
  (font-lock-comment-face
   :foreground @muted
   :slant italic
   :inherit fixed-pitch)
  (font-lock-builtin-face
   :foreground @builtin
   :inherit fixed-pitch)
  (font-lock-string-face
   :inherit fixed-pitch
   :foreground @string)
  (font-lock-function-name-face
   :inherit fixed-pitch
   :foreground @function-name)
  (font-lock-keyword-face
   :inherit fixed-pitch
   :inherit bold
   :foreground @keyword)
  (font-lock-comment-delimiter-face
   :inherit fixed-pitch
   :inherit font-lock-comment-face)
  (font-lock-constant-face
   :inherit fixed-pitch
   :foreground @constant)
  (font-lock-doc-face
   :foreground @muted
   :inherit fixed-pitch)
  (font-lock-preprocessor-face
   :inherit fixed-pitch
   :foreground @preprocessor)
  (font-lock-regexp-grouping-backslash
   :inherit fixed-pitch
   :inherit bold)
  (font-lock-regexp-grouping-construct
   :inherit fixed-pitch
   :inherit bold)
  (font-lock-type-face
   :foreground @type
   :inherit fixed-pitch)
  (font-lock-variable-name-face
   :inherit fixed-pitch
   :foreground @variable)
  (font-lock-warning-face
   :inherit error)

;; Org
  (org-level-1 :inherit default :foreground @header :weight regular :height 1.4)
  (org-level-2 :inherit default :foreground @header :weight regular :height 1.3)
  (org-level-3 :inherit default :foreground @header :weight regular :height 1.2)
  (org-level-4 :inherit default :foreground @header :weight regular :height 1.1)
  (org-meta-line
   :inherit fixed-pitch
   :foreground @org-meta)
  (org-document-info-keyword
   :inherit fixed-pitch
   :foreground @org-document-info)
  (org-document-info
   :inherit default
   :foreground @org-document-info)
  (org-verbatim ; inline code
   :foreground @fg
   :inherit fixed-pitch)
  (org-code
   :inherit fixed-pitch)
  (org-link
   :foreground @link
   :underline t
   :inherit fixed-pitch)
  (org-roam-link-invalid
   :foreground @link
   :underline t
   :inherit fixed-pitch)
  (org-table
   :inherit fixed-pitch
   :background @org-table)
  (org-formula
   :inherit org-table
   :height 1)
  (org-verse
   :inherit default
   :foreground @org-quote-fg
   :background @org-quote-bg)
  (org-quote
   :inherit default
   :foreground @org-quote-fg
   :background @org-quote-bg)
  (org-hide
   :inherit fixed-pitch
   :foreground @bg)
  (org-ellipsis
   :foreground @org-ellipsis)
  (org-indent
   :inherit org-hide)
  (org-date
   :inherit fixed-pitch
   :foreground @org-date
   :underline nil)
  (org-document-title
   :inherit default
   :foreground @org-title
   :height 2.0
   :underline (:color @org-title-underline))
  (org-checkbox
   :inherit fixed-pitch
   :weight bold
   :foreground @org-checkbox)
  (org-done
   :inherit fixed-pitch
   :foreground @org-done)
  (org-todo
   :inherit fixed-pitch
   :weight bold
   :foreground @org-todo)
  (org-tag
   :inherit fixed-pitch
   :height 1.0
   :foreground @org-tag)
  (org-block-begin-line
   :inherit fixed-pitch
   :background @org-block-line
   :extend t)
  (org-block-end-line
   :inherit fixed-pitch
   :background @org-block-line
   :extend t)
  (org-block
   :background @org-block-bg
   :inherit fixed-pitch
   :height 0.9
   :extend t)
  (org-priority
   :inherit fixed-pitch
   :weight normal)
  (org-agenda-structure
   :foreground @org-agenda-structure-fg
   :background @bg
   :box (:line-width 3 :color @bg)
   :underline @org-agenda-structure-bg)
  (org-scheduled
   :foreground @org-scheduled)
  (org-scheduled-today
   :foreground @org-scheduled-today)
  (org-agenda-date-weekend
   :inherit org-agenda-structure)
  (org-agenda-date-today
   :box (:line-width 3 :color @org-agenda-today-bg)
   :foreground @org-agenda-today-fg
   :background @org-agenda-today-bg)
  (org-scheduled-previously
   :foreground @org-sched-prev)
  (org-imminent-deadline
   :foreground @org-deadline)
  (org-agenda-done
   :foreground @org-agenda-done)
  (org-footnote
   :foreground @link)
  (org-drawer
   :inherit fixed-pitch
   :foreground @org-meta)
  (org-special-keyword
   :inherit fixed-pitch
   :foreground @org-special-keyword)
  (org-property-value
   :inherit fixed-pitch)

;; Eshell
  (eshell-prompt
   :foreground @eshell-prompt)

;; Helm
  (helm-header
   :inherit fixed-pitch
   :foreground @helm-header-fg
   :background @helm-header-bg)
  (helm-source-header
   :inherit fixed-pitch
   :foreground @helm-source-header-fg
   :background @helm-source-header-bg)
  (helm-selection
   :background @bg-hlt)

;; Whitespace
  (whitespace-tab
   :background @whitespace-tab)

;; LaTeX
  (font-latex-sectioning-5-face
   :foreground @fg)
  (font-latex-italic-face
   :inherit italic
   :foreground @muted)
)
#+END_SRC

* Instantiate structure using color palette

This block resolves the =@=-prefixed variables of the theme structure using a given table of colors.

#+NAME: theme-generator
#+BEGIN_SRC emacs-lisp :var palette='() structure=structure theme-name=""
(defun process (x)
  (cond
   ((not x)                                     '())
   ((listp x)                                   (cons (process (car x)) (process (cdr x))))
   ((and (symbolp x)
         (string-prefix-p "@" (symbol-name x))) (cadr (assoc (substring (symbol-name x) 1) (cdr palette))))
   (t                                           x)))

(print `(apply
          'custom-theme-set-faces
          ',(make-symbol theme-name)
          ',(mapcar (lambda (x) `(,(car x) ((t ,(cdr x)))))
                    (process structure)))))

#+END_SRC