forked from protesilaos/modus-themes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
modus-vivendi-tritanopia-theme.el
543 lines (434 loc) · 15.8 KB
/
modus-vivendi-tritanopia-theme.el
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
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
;;; modus-vivendi-tritanopia-theme.el --- Tritanopia-optimized theme with a black background -*- lexical-binding:t -*-
;; Copyright (C) 2019-2024 Free Software Foundation, Inc.
;; Author: Protesilaos Stavrou <[email protected]>
;; Maintainer: Protesilaos Stavrou <[email protected]>
;; URL: https://github.com/protesilaos/modus-themes
;; Keywords: faces, theme, accessibility
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; The Modus themes conform with the highest standard for
;; color-contrast accessibility between background and foreground
;; values (WCAG AAA). Please refer to the official Info manual for
;; further documentation (distributed with the themes, or available
;; at: <https://protesilaos.com/emacs/modus-themes>).
;;; Code:
(eval-and-compile
(unless (and (fboundp 'require-theme)
load-file-name
(equal (file-name-directory load-file-name)
(expand-file-name "themes/" data-directory))
(require-theme 'modus-themes t))
(require 'modus-themes))
;;;###theme-autoload
(deftheme modus-vivendi-tritanopia
"Tritanopia-optimized theme with a black background.
This variant is optimized for users with blue-yellow color
deficiency (tritanopia). It conforms with the highest
legibility standard for color contrast between background and
foreground in any given piece of text, which corresponds to a
minimum contrast in relative luminance of 7:1 (WCAG AAA
standard)."
:background-mode 'dark
:kind 'color-scheme
:family 'modus)
(defconst modus-vivendi-tritanopia-palette
'(
;;; Basic values
(bg-main "#000000")
(bg-dim "#1e1e1e")
(fg-main "#ffffff")
(fg-dim "#989898")
(fg-alt "#c6daff")
(bg-active "#535353")
(bg-inactive "#303030")
(border "#646464")
;;; Common accent foregrounds
(red "#ff5f59")
(red-warmer "#ff6740")
(red-cooler "#ff7f86")
(red-faint "#ff9070")
(red-intense "#ff5f5f")
(green "#44bc44")
(green-warmer "#70b900")
(green-cooler "#00c06f")
(green-faint "#88ca9f")
(green-intense "#44df44")
(yellow "#cabf00")
(yellow-warmer "#ffa00f")
(yellow-cooler "#d8af7a")
(yellow-faint "#d2b580")
(yellow-intense "#efef00")
(blue "#2fafff")
(blue-warmer "#79a8ff")
(blue-cooler "#00bcff")
(blue-faint "#82b0ec")
(blue-intense "#338fff")
(magenta "#feacd0")
(magenta-warmer "#f78fe7")
(magenta-cooler "#b6a0ff")
(magenta-faint "#caa6df")
(magenta-intense "#ef7fff")
(cyan "#00d3d0")
(cyan-warmer "#4ae2ff")
(cyan-cooler "#6ae4b9")
(cyan-faint "#7fdbdf")
(cyan-intense "#00eff0")
;;; Uncommon accent foregrounds
(rust "#db7b5f")
(gold "#c0965b")
(olive "#9cbd6f")
(slate "#76afbf")
(indigo "#9099d9")
(maroon "#cf7fa7")
(pink "#d09dc0")
;;; Common accent backgrounds
(bg-red-intense "#9d1f1f")
(bg-green-intense "#2f822f")
(bg-yellow-intense "#7a6100")
(bg-blue-intense "#1640b0")
(bg-magenta-intense "#7030af")
(bg-cyan-intense "#2266ae")
(bg-red-subtle "#620f2a")
(bg-green-subtle "#00422a")
(bg-yellow-subtle "#4a4000")
(bg-blue-subtle "#242679")
(bg-magenta-subtle "#552f5f")
(bg-cyan-subtle "#004065")
(bg-red-nuanced "#3a0c14")
(bg-green-nuanced "#092f1f")
(bg-yellow-nuanced "#381d0f")
(bg-blue-nuanced "#12154a")
(bg-magenta-nuanced "#2f0c3f")
(bg-cyan-nuanced "#042837")
;;; Uncommon accent background and foreground pairs
(bg-clay "#49191a")
(fg-clay "#f1b090")
(bg-ochre "#462f20")
(fg-ochre "#e0d09c")
(bg-lavender "#38325c")
(fg-lavender "#dfc0f0")
(bg-sage "#143e32")
(fg-sage "#c3e7d4")
;;; Graphs
(bg-graph-red-0 "#b52c2c")
(bg-graph-red-1 "#702020")
(bg-graph-green-0 "#afd1c0")
(bg-graph-green-1 "#607a8f")
(bg-graph-yellow-0 "#facfd6")
(bg-graph-yellow-1 "#b57b85")
(bg-graph-blue-0 "#4f9fdf")
(bg-graph-blue-1 "#004559")
(bg-graph-magenta-0 "#b6427f")
(bg-graph-magenta-1 "#7f506f")
(bg-graph-cyan-0 "#57dfea")
(bg-graph-cyan-1 "#00808f")
;;; Special purpose
(bg-completion "#004253")
(bg-hover "#8e3e3b")
(bg-hover-secondary "#00405f")
(bg-hl-line "#2f3849")
(bg-region "#5a5a5a")
(fg-region "#ffffff")
(bg-char-0 "#922a00")
(bg-char-1 "#00709f")
(bg-char-2 "#5f3faf")
(bg-mode-line-active "#003c52")
(fg-mode-line-active "#f0f0f0")
(border-mode-line-active "#5f8fb4")
(bg-mode-line-inactive "#2d2d2d")
(fg-mode-line-inactive "#969696")
(border-mode-line-inactive "#606060")
(modeline-err "#ff7fbf")
(modeline-warning "#df9f93")
(modeline-info "#4fcfef")
(bg-tab-bar "#313131")
(bg-tab-current "#000000")
(bg-tab-other "#545454")
;;; Diffs
(bg-added "#004254")
(bg-added-faint "#003042")
(bg-added-refine "#004f7f")
(bg-added-fringe "#008fcf")
(fg-added "#9fdfdf")
(fg-added-intense "#50c0ef")
(bg-changed "#2f123f")
(bg-changed-faint "#1f022f")
(bg-changed-refine "#3f325f")
(bg-changed-fringe "#7f55a0")
(fg-changed "#e3cfff")
(fg-changed-intense "#cf9fe2")
(bg-removed "#4f1119")
(bg-removed-faint "#380a0f")
(bg-removed-refine "#781a1f")
(bg-removed-fringe "#b81a1f")
(fg-removed "#ffbfbf")
(fg-removed-intense "#ff9095")
(bg-diff-context "#1a1a1a")
;;; Paren match
(bg-paren-match "#2f7f9f")
(fg-paren-match fg-main)
(bg-paren-expression "#453040")
(underline-paren-match unspecified)
;;; Mappings
;;;; General mappings
(fringe bg-dim)
(cursor red-intense)
(keybind red)
(name red-cooler)
(identifier red-faint)
(err red-warmer)
(warning magenta)
(info cyan)
(underline-err red-intense)
(underline-warning magenta-intense)
(underline-note cyan-intense)
(bg-prominent-err bg-red-intense)
(fg-prominent-err fg-main)
(bg-prominent-warning bg-magenta-intense)
(fg-prominent-warning fg-main)
(bg-prominent-note bg-cyan-intense)
(fg-prominent-note fg-main)
(bg-active-argument bg-red-nuanced)
(fg-active-argument red-warmer)
(bg-active-value bg-cyan-nuanced)
(fg-active-value cyan)
;;;; Code mappings
(bracket fg-main)
(builtin magenta)
(comment red-faint)
(constant green-faint)
(delimiter fg-main)
(docmarkup magenta-faint)
(docstring fg-alt)
(fnname cyan-warmer)
(keyword red-cooler)
(number fg-main)
(operator fg-main)
(preprocessor red-warmer)
(punctuation fg-main)
(rx-backslash magenta)
(rx-construct red)
(string cyan)
(type blue-warmer)
(variable cyan-cooler)
;;;; Accent mappings
(accent-0 cyan)
(accent-1 red-warmer)
(accent-2 cyan-cooler)
(accent-3 magenta)
;;;; Button mappings
(fg-button-active fg-main)
(fg-button-inactive fg-dim)
(bg-button-active bg-active)
(bg-button-inactive bg-dim)
;;;; Completion mappings
(fg-completion-match-0 cyan)
(fg-completion-match-1 red-warmer)
(fg-completion-match-2 magenta)
(fg-completion-match-3 cyan-cooler)
(bg-completion-match-0 unspecified)
(bg-completion-match-1 unspecified)
(bg-completion-match-2 unspecified)
(bg-completion-match-3 unspecified)
;;;; Date mappings
(date-common cyan-cooler)
(date-deadline red)
(date-deadline-subtle red-faint)
(date-event fg-alt)
(date-holiday red-intense)
(date-holiday-other cyan-warmer)
(date-now fg-main)
(date-range fg-alt)
(date-scheduled magenta)
(date-scheduled-subtle magenta-faint)
(date-weekday cyan)
(date-weekend magenta-warmer)
;;;; Line number mappings
(fg-line-number-inactive fg-dim)
(fg-line-number-active fg-main)
(bg-line-number-inactive bg-dim)
(bg-line-number-active bg-active)
;;;; Link mappings
(fg-link cyan)
(bg-link unspecified)
(underline-link cyan)
(fg-link-symbolic cyan-cooler)
(bg-link-symbolic unspecified)
(underline-link-symbolic cyan-cooler)
(fg-link-visited magenta)
(bg-link-visited unspecified)
(underline-link-visited magenta)
;;;; Mail mappings
(mail-cite-0 cyan-faint)
(mail-cite-1 red-faint)
(mail-cite-2 magenta-warmer)
(mail-cite-3 cyan-warmer)
(mail-part cyan-cooler)
(mail-recipient cyan)
(mail-subject red-cooler)
(mail-other cyan)
;;;; Mark mappings
(bg-mark-delete bg-red-subtle)
(fg-mark-delete red)
(bg-mark-select bg-cyan-subtle)
(fg-mark-select cyan)
(bg-mark-other bg-magenta-subtle)
(fg-mark-other magenta-warmer)
;;;; Prompt mappings
(fg-prompt cyan-cooler)
(bg-prompt unspecified)
;;;; Prose mappings
(bg-prose-block-delimiter bg-dim)
(fg-prose-block-delimiter fg-dim)
(bg-prose-block-contents bg-dim)
(bg-prose-code unspecified)
(fg-prose-code cyan)
(bg-prose-macro unspecified)
(fg-prose-macro red-warmer)
(bg-prose-verbatim unspecified)
(fg-prose-verbatim magenta-warmer)
(prose-done cyan)
(prose-todo red)
(prose-metadata fg-dim)
(prose-metadata-value fg-alt)
(prose-table fg-alt)
(prose-table-formula red-cooler)
(prose-tag magenta-faint)
;;;; Rainbow mappings
(rainbow-0 cyan)
(rainbow-1 red)
(rainbow-2 cyan-warmer)
(rainbow-3 red-cooler)
(rainbow-4 cyan-cooler)
(rainbow-5 magenta)
(rainbow-6 cyan-faint)
(rainbow-7 magenta-faint)
(rainbow-8 red-faint)
;;;; Search mappings
(bg-search-current bg-red-intense)
(bg-search-lazy bg-cyan-intense)
(bg-search-replace bg-magenta-intense)
(bg-search-rx-group-0 bg-blue-intense)
(bg-search-rx-group-1 bg-magenta-intense)
(bg-search-rx-group-2 bg-cyan-subtle)
(bg-search-rx-group-3 bg-red-subtle)
;;;; Space mappings
(bg-space unspecified)
(fg-space border)
(bg-space-err bg-red-intense)
;;;; Terminal mappings
(bg-term-black "#000000")
(fg-term-black "#000000")
(bg-term-black-bright "#595959")
(fg-term-black-bright "#595959")
(bg-term-red red)
(fg-term-red red)
(bg-term-red-bright red-warmer)
(fg-term-red-bright red-warmer)
(bg-term-green green)
(fg-term-green green)
(bg-term-green-bright green-cooler)
(fg-term-green-bright green-cooler)
(bg-term-yellow yellow)
(fg-term-yellow yellow)
(bg-term-yellow-bright yellow-warmer)
(fg-term-yellow-bright yellow-warmer)
(bg-term-blue blue)
(fg-term-blue blue)
(bg-term-blue-bright blue-warmer)
(fg-term-blue-bright blue-warmer)
(bg-term-magenta magenta)
(fg-term-magenta magenta)
(bg-term-magenta-bright magenta-cooler)
(fg-term-magenta-bright magenta-cooler)
(bg-term-cyan cyan)
(fg-term-cyan cyan)
(bg-term-cyan-bright cyan-cooler)
(fg-term-cyan-bright cyan-cooler)
(bg-term-white "#a6a6a6")
(fg-term-white "#a6a6a6")
(bg-term-white-bright "#ffffff")
(fg-term-white-bright "#ffffff")
;;;; Heading mappings
(fg-heading-0 cyan-cooler)
(fg-heading-1 fg-main)
(fg-heading-2 red-faint)
(fg-heading-3 cyan-faint)
(fg-heading-4 magenta)
(fg-heading-5 green-faint)
(fg-heading-6 magenta-faint)
(fg-heading-7 cyan-faint)
(fg-heading-8 fg-dim)
(bg-heading-0 unspecified)
(bg-heading-1 unspecified)
(bg-heading-2 unspecified)
(bg-heading-3 unspecified)
(bg-heading-4 unspecified)
(bg-heading-5 unspecified)
(bg-heading-6 unspecified)
(bg-heading-7 unspecified)
(bg-heading-8 unspecified)
(overline-heading-0 unspecified)
(overline-heading-1 unspecified)
(overline-heading-2 unspecified)
(overline-heading-3 unspecified)
(overline-heading-4 unspecified)
(overline-heading-5 unspecified)
(overline-heading-6 unspecified)
(overline-heading-7 unspecified)
(overline-heading-8 unspecified))
"The entire palette of the `modus-vivendi-tritanopia' theme.
Named colors have the form (COLOR-NAME HEX-VALUE) with the former
as a symbol and the latter as a string.
Semantic color mappings have the form (MAPPING-NAME COLOR-NAME)
with both as symbols. The latter is a named color that already
exists in the palette and is associated with a HEX-VALUE.")
(defcustom modus-vivendi-tritanopia-palette-user nil
"Like the `modus-vivendi-tritanopia-palette' for user-defined entries.
This is meant to extend the palette with custom named colors and/or
semantic palette mappings. Those may then be used in combination with
palette overrides (also see `modus-themes-common-palette-overrides' and
`modus-vivendi-tritanopia-palette-overrides')."
:group 'modus-themes
:package-version '(modus-themes . "4.5.0")
:type '(repeat (list symbol (choice symbol string)))
:set #'modus-themes--set-option
:initialize #'custom-initialize-default
:link '(info-link "(modus-themes) Option to extend the palette for use with overrides"))
(defcustom modus-vivendi-tritanopia-palette-overrides nil
"Overrides for `modus-vivendi-tritanopia-palette'.
Mirror the elements of the aforementioned palette, overriding
their value.
For overrides that are shared across all of the Modus themes,
refer to `modus-themes-common-palette-overrides'.
Theme-specific overrides take precedence over shared overrides.
The idea of common overrides is to change semantic color
mappings, such as to make the cursor red. Wherea theme-specific
overrides can also be used to change the value of a named color,
such as what hexadecimal RGB value the red-warmer symbol
represents."
:group 'modus-themes
:package-version '(modus-themes . "4.0.0")
:version "30.1"
:type '(repeat (list symbol (choice symbol string)))
:set #'modus-themes--set-option
:initialize #'custom-initialize-default
:link '(info-link "(modus-themes) Palette overrides"))
(modus-themes-theme modus-vivendi-tritanopia
modus-vivendi-tritanopia-palette
modus-vivendi-tritanopia-palette-overrides)
(provide-theme 'modus-vivendi-tritanopia))
;;; modus-vivendi-tritanopia-theme.el ends here