modus-vivendi-deuteranopia-theme.el (14499B)
1 ;;; modus-vivendi-deuteranopia-theme.el --- Deuteranopia-optimized theme with a black background -*- lexical-binding:t -*- 2 3 ;; Copyright (C) 2019-2023 Free Software Foundation, Inc. 4 5 ;; Author: Protesilaos Stavrou <info@protesilaos.com> 6 ;; Maintainer: Modus-Themes Development <~protesilaos/modus-themes@lists.sr.ht> 7 ;; URL: https://git.sr.ht/~protesilaos/modus-themes 8 ;; Mailing-List: https://lists.sr.ht/~protesilaos/modus-themes 9 10 ;; This file is part of GNU Emacs. 11 12 ;; GNU Emacs is free software: you can redistribute it and/or modify 13 ;; it under the terms of the GNU General Public License as published by 14 ;; the Free Software Foundation, either version 3 of the License, or 15 ;; (at your option) any later version. 16 ;; 17 ;; GNU Emacs is distributed in the hope that it will be useful, 18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 ;; GNU General Public License for more details. 21 ;; 22 ;; You should have received a copy of the GNU General Public License 23 ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. 24 25 ;;; Commentary: 26 ;; 27 ;; The Modus themes conform with the highest standard for 28 ;; color-contrast accessibility between background and foreground 29 ;; values (WCAG AAA). Please refer to the official Info manual for 30 ;; further documentation (distributed with the themes, or available 31 ;; at: <https://protesilaos.com/emacs/modus-themes>). 32 33 ;;; Code: 34 35 36 37 (eval-and-compile 38 (unless (and (fboundp 'require-theme) 39 load-file-name 40 (equal (file-name-directory load-file-name) 41 (expand-file-name "themes/" data-directory)) 42 (require-theme 'modus-themes t)) 43 (require 'modus-themes)) 44 45 ;;;###theme-autoload 46 (deftheme modus-vivendi-deuteranopia 47 "Deuteranopia-optimized theme with a black background. 48 This variant is optimized for users with red-green color 49 deficiency (deuteranopia). It conforms with the highest 50 legibility standard for color contrast between background and 51 foreground in any given piece of text, which corresponds to a 52 minimum contrast in relative luminance of 7:1 (WCAG AAA 53 standard)." 54 :background-mode 'dark 55 :kind 'color-scheme 56 :family 'modus) 57 58 (defconst modus-vivendi-deuteranopia-palette 59 '( 60 ;;; Basic values 61 62 (bg-main "#000000") 63 (bg-dim "#1e1e1e") 64 (fg-main "#ffffff") 65 (fg-dim "#989898") 66 (fg-alt "#c6daff") 67 (bg-active "#535353") 68 (bg-inactive "#303030") 69 (border "#646464") 70 71 ;;; Common accent foregrounds 72 73 (red "#ff5f59") 74 (red-warmer "#ff6b55") 75 (red-cooler "#ff7f9f") 76 (red-faint "#ff9580") 77 (red-intense "#ff5f5f") 78 (green "#44bc44") 79 (green-warmer "#70b900") 80 (green-cooler "#00c06f") 81 (green-faint "#88ca9f") 82 (green-intense "#44df44") 83 (yellow "#cabf00") 84 (yellow-warmer "#ffa00f") 85 (yellow-cooler "#d8af7a") 86 (yellow-faint "#d2b580") 87 (yellow-intense "#efef00") 88 (blue "#2fafff") 89 (blue-warmer "#79a8ff") 90 (blue-cooler "#00bcff") 91 (blue-faint "#82b0ec") 92 (blue-intense "#338fff") 93 (magenta "#feacd0") 94 (magenta-warmer "#f78fe7") 95 (magenta-cooler "#b6a0ff") 96 (magenta-faint "#caa6df") 97 (magenta-intense "#ff66ff") 98 (cyan "#00d3d0") 99 (cyan-warmer "#4ae2f0") 100 (cyan-cooler "#6ae4b9") 101 (cyan-faint "#9ac8e0") 102 (cyan-intense "#00eff0") 103 104 ;;; Uncommon accent foregrounds 105 106 (rust "#db7b5f") 107 (gold "#c0965b") 108 (olive "#9cbd6f") 109 (slate "#76afbf") 110 (indigo "#9099d9") 111 (maroon "#cf7fa7") 112 (pink "#d09dc0") 113 114 ;;; Common accent backgrounds 115 116 (bg-red-intense "#9d1f1f") 117 (bg-green-intense "#2f822f") 118 (bg-yellow-intense "#7a6100") 119 (bg-blue-intense "#1640b0") 120 (bg-magenta-intense "#7030af") 121 (bg-cyan-intense "#2266ae") 122 123 (bg-red-subtle "#620f2a") 124 (bg-green-subtle "#00422a") 125 (bg-yellow-subtle "#4a4000") 126 (bg-blue-subtle "#242679") 127 (bg-magenta-subtle "#552f5f") 128 (bg-cyan-subtle "#004065") 129 130 (bg-red-nuanced "#2c0614") 131 (bg-green-nuanced "#001904") 132 (bg-yellow-nuanced "#221000") 133 (bg-blue-nuanced "#0f0e39") 134 (bg-magenta-nuanced "#230631") 135 (bg-cyan-nuanced "#041529") 136 137 ;;; Uncommon accent backgrounds 138 139 (bg-ochre "#442c2f") 140 (bg-lavender "#38325c") 141 (bg-sage "#0f3d30") 142 143 ;;; Graphs 144 145 (bg-graph-red-0 "#bf6000") 146 (bg-graph-red-1 "#733500") 147 (bg-graph-green-0 "#6fbf8f") 148 (bg-graph-green-1 "#2f5f4f") 149 (bg-graph-yellow-0 "#c1c00a") 150 (bg-graph-yellow-1 "#7f6640") 151 (bg-graph-blue-0 "#0f90ef") 152 (bg-graph-blue-1 "#1f2f8f") 153 (bg-graph-magenta-0 "#7f7f8e") 154 (bg-graph-magenta-1 "#4f4f5f") 155 (bg-graph-cyan-0 "#376f9a") 156 (bg-graph-cyan-1 "#00404f") 157 158 ;;; Special purpose 159 160 (bg-completion "#2f447f") 161 (bg-hover "#45605e") 162 (bg-hover-secondary "#654a39") 163 (bg-hl-line "#2f3849") 164 (bg-region "#5a5a5a") 165 (fg-region "#ffffff") 166 167 (bg-char-0 "#0050af") 168 (bg-char-1 "#7f1f7f") 169 (bg-char-2 "#625a00") 170 171 (bg-mode-line-active "#2a2a6a") 172 (fg-mode-line-active "#f0f0f0") 173 (border-mode-line-active "#8080a7") 174 (bg-mode-line-inactive "#2d2d2d") 175 (fg-mode-line-inactive "#969696") 176 (border-mode-line-inactive "#606060") 177 178 (modeline-err "#e5bf00") 179 (modeline-warning "#c0cf35") 180 (modeline-info "#abeadf") 181 182 (bg-tab-bar "#313131") 183 (bg-tab-current "#000000") 184 (bg-tab-other "#545454") 185 186 ;;; Diffs 187 188 (bg-added "#003066") 189 (bg-added-faint "#001a4f") 190 (bg-added-refine "#0f4a77") 191 (bg-added-fringe "#006fff") 192 (fg-added "#c4d5ff") 193 (fg-added-intense "#8080ff") 194 195 (bg-changed "#2f123f") 196 (bg-changed-faint "#1f022f") 197 (bg-changed-refine "#3f325f") 198 (bg-changed-fringe "#7f55a0") 199 (fg-changed "#e3cfff") 200 (fg-changed-intense "#cf9fe2") 201 202 (bg-removed "#3d3d00") 203 (bg-removed-faint "#281f00") 204 (bg-removed-refine "#555500") 205 (bg-removed-fringe "#d0c03f") 206 (fg-removed "#d4d48f") 207 (fg-removed-intense "#d0b05f") 208 209 (bg-diff-context "#1a1a1a") 210 211 ;;; Paren match 212 213 (bg-paren-match "#2f7f9f") 214 (bg-paren-expression "#453040") 215 (underline-paren-match unspecified) 216 217 ;;; Mappings 218 219 ;;;; General mappings 220 221 (fringe bg-dim) 222 (cursor yellow-intense) 223 224 (keybind blue-cooler) 225 (name blue-cooler) 226 (identifier yellow-faint) 227 228 (err yellow-warmer) 229 (warning yellow) 230 (info blue) 231 232 (underline-err yellow-intense) 233 (underline-warning magenta-faint) 234 (underline-note cyan) 235 236 (bg-prominent-err bg-yellow-intense) 237 (fg-prominent-err fg-main) 238 (bg-prominent-warning bg-magenta-intense) 239 (fg-prominent-warning fg-main) 240 (bg-prominent-note bg-cyan-intense) 241 (fg-prominent-note fg-main) 242 243 ;;;; Code mappings 244 245 (builtin magenta-warmer) 246 (comment yellow-cooler) 247 (constant blue-cooler) 248 (docstring cyan-faint) 249 (docmarkup magenta-faint) 250 (fnname magenta) 251 (keyword magenta-cooler) 252 (preprocessor red-cooler) 253 (string blue-warmer) 254 (type cyan-cooler) 255 (variable cyan) 256 (rx-construct yellow-cooler) 257 (rx-backslash blue-cooler) 258 259 ;;;; Accent mappings 260 261 (accent-0 blue-cooler) 262 (accent-1 yellow) 263 (accent-2 cyan-cooler) 264 (accent-3 magenta-warmer) 265 266 ;;;; Button mappings 267 268 (fg-button-active fg-main) 269 (fg-button-inactive fg-dim) 270 (bg-button-active bg-active) 271 (bg-button-inactive bg-dim) 272 273 ;;;; Completion mappings 274 275 (fg-completion-match-0 blue-cooler) 276 (fg-completion-match-1 yellow) 277 (fg-completion-match-2 cyan-cooler) 278 (fg-completion-match-3 magenta-warmer) 279 (bg-completion-match-0 unspecified) 280 (bg-completion-match-1 unspecified) 281 (bg-completion-match-2 unspecified) 282 (bg-completion-match-3 unspecified) 283 284 ;;;; Date mappings 285 286 (date-common cyan) 287 (date-deadline yellow-warmer) 288 (date-event fg-alt) 289 (date-holiday yellow-warmer) 290 (date-holiday-other blue) 291 (date-now blue-faint) 292 (date-range fg-alt) 293 (date-scheduled yellow-cooler) 294 (date-weekday cyan) 295 (date-weekend yellow-faint) 296 297 ;;;; Line number mappings 298 299 (fg-line-number-inactive fg-dim) 300 (fg-line-number-active fg-main) 301 (bg-line-number-inactive bg-dim) 302 (bg-line-number-active bg-active) 303 304 ;;;; Link mappings 305 306 (fg-link blue-warmer) 307 (bg-link unspecified) 308 (underline-link blue-warmer) 309 310 (fg-link-symbolic cyan) 311 (bg-link-symbolic unspecified) 312 (underline-link-symbolic cyan) 313 314 (fg-link-visited yellow-faint) 315 (bg-link-visited unspecified) 316 (underline-link-visited yellow-faint) 317 318 ;;;; Mail mappings 319 320 (mail-cite-0 blue-warmer) 321 (mail-cite-1 yellow-cooler) 322 (mail-cite-2 cyan-faint) 323 (mail-cite-3 yellow) 324 (mail-part blue) 325 (mail-recipient blue) 326 (mail-subject yellow-warmer) 327 (mail-other cyan-faint) 328 329 ;;;; Mark mappings 330 331 (bg-mark-delete bg-yellow-subtle) 332 (fg-mark-delete yellow) 333 (bg-mark-select bg-cyan-subtle) 334 (fg-mark-select cyan) 335 (bg-mark-other bg-magenta-subtle) 336 (fg-mark-other magenta-warmer) 337 338 ;;;; Prompt mappings 339 340 (fg-prompt blue) 341 (bg-prompt unspecified) 342 343 ;;;; Prose mappings 344 345 (prose-block fg-dim) 346 (prose-code cyan-cooler) 347 (prose-done blue) 348 (prose-macro magenta-cooler) 349 (prose-metadata fg-dim) 350 (prose-metadata-value fg-alt) 351 (prose-table fg-alt) 352 (prose-tag magenta-faint) 353 (prose-todo yellow-warmer) 354 (prose-verbatim magenta-warmer) 355 356 ;;;; Rainbow mappings 357 358 (rainbow-0 yellow-warmer) 359 (rainbow-1 blue) 360 (rainbow-2 yellow-cooler) 361 (rainbow-3 blue-warmer) 362 (rainbow-4 yellow) 363 (rainbow-5 cyan-warmer) 364 (rainbow-6 yellow-faint) 365 (rainbow-7 blue-faint) 366 (rainbow-8 magenta-faint) 367 368 ;;;; Space mappings 369 370 (bg-space unspecified) 371 (fg-space border) 372 (bg-space-err bg-yellow-intense) 373 374 ;;;; Terminal mappings 375 376 (bg-term-black "black") 377 (fg-term-black "black") 378 (bg-term-black-bright "gray35") 379 (fg-term-black-bright "gray35") 380 381 (bg-term-red red) 382 (fg-term-red red) 383 (bg-term-red-bright red-warmer) 384 (fg-term-red-bright red-warmer) 385 386 (bg-term-green green) 387 (fg-term-green green) 388 (bg-term-green-bright green-cooler) 389 (fg-term-green-bright green-cooler) 390 391 (bg-term-yellow yellow) 392 (fg-term-yellow yellow) 393 (bg-term-yellow-bright yellow-warmer) 394 (fg-term-yellow-bright yellow-warmer) 395 396 (bg-term-blue blue) 397 (fg-term-blue blue) 398 (bg-term-blue-bright blue-warmer) 399 (fg-term-blue-bright blue-warmer) 400 401 (bg-term-magenta magenta) 402 (fg-term-magenta magenta) 403 (bg-term-magenta-bright magenta-cooler) 404 (fg-term-magenta-bright magenta-cooler) 405 406 (bg-term-cyan cyan) 407 (fg-term-cyan cyan) 408 (bg-term-cyan-bright cyan-cooler) 409 (fg-term-cyan-bright cyan-cooler) 410 411 (bg-term-white "gray65") 412 (fg-term-white "gray65") 413 (bg-term-white-bright "white") 414 (fg-term-white-bright "white") 415 416 ;;;; Heading mappings 417 418 (fg-heading-0 cyan-cooler) 419 (fg-heading-1 fg-main) 420 (fg-heading-2 yellow-faint) 421 (fg-heading-3 blue-faint) 422 (fg-heading-4 magenta) 423 (fg-heading-5 green-faint) 424 (fg-heading-6 red-faint) 425 (fg-heading-7 cyan-faint) 426 (fg-heading-8 fg-dim) 427 428 (bg-heading-0 unspecified) 429 (bg-heading-1 unspecified) 430 (bg-heading-2 unspecified) 431 (bg-heading-3 unspecified) 432 (bg-heading-4 unspecified) 433 (bg-heading-5 unspecified) 434 (bg-heading-6 unspecified) 435 (bg-heading-7 unspecified) 436 (bg-heading-8 unspecified) 437 438 (overline-heading-0 unspecified) 439 (overline-heading-1 unspecified) 440 (overline-heading-2 unspecified) 441 (overline-heading-3 unspecified) 442 (overline-heading-4 unspecified) 443 (overline-heading-5 unspecified) 444 (overline-heading-6 unspecified) 445 (overline-heading-7 unspecified) 446 (overline-heading-8 unspecified)) 447 "The entire palette of the `modus-vivendi-deuteranopia' theme. 448 449 Named colors have the form (COLOR-NAME HEX-VALUE) with the former 450 as a symbol and the latter as a string. 451 452 Semantic color mappings have the form (MAPPING-NAME COLOR-NAME) 453 with both as symbols. The latter is a named color that already 454 exists in the palette and is associated with a HEX-VALUE.") 455 456 (defcustom modus-vivendi-deuteranopia-palette-overrides nil 457 "Overrides for `modus-vivendi-deuteranopia-palette'. 458 459 Mirror the elements of the aforementioned palette, overriding 460 their value. 461 462 For overrides that are shared across all of the Modus themes, 463 refer to `modus-themes-common-palette-overrides'. 464 465 Theme-specific overrides take precedence over shared overrides. 466 The idea of common overrides is to change semantic color 467 mappings, such as to make the cursor red. Wherea theme-specific 468 overrides can also be used to change the value of a named color, 469 such as what hexadecimal RGB value the red-warmer symbol 470 represents." 471 :group 'modus-themes 472 :package-version '(modus-themes . "4.0.0") 473 :version "30.1" 474 :type '(repeat (list symbol (choice symbol string))) 475 :set #'modus-themes--set-option 476 :initialize #'custom-initialize-default 477 :link '(info-link "(modus-themes) Palette overrides")) 478 479 (modus-themes-theme modus-vivendi-deuteranopia 480 modus-vivendi-deuteranopia-palette 481 modus-vivendi-deuteranopia-palette-overrides) 482 483 (provide-theme 'modus-vivendi-deuteranopia)) 484 485 ;;; modus-vivendi-deuteranopia-theme.el ends here