modus-vivendi-deuteranopia-theme.el (15257B)
1 ;;; modus-vivendi-deuteranopia-theme.el --- Deuteranopia-optimized theme with a black background -*- lexical-binding:t -*- 2 3 ;; Copyright (C) 2019-2024 Free Software Foundation, Inc. 4 5 ;; Author: Protesilaos Stavrou <info@protesilaos.com> 6 ;; Maintainer: Protesilaos Stavrou <info@protesilaos.com> 7 ;; URL: https://github.com/protesilaos/modus-themes 8 ;; Keywords: faces, theme, accessibility 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 "#3a0c14") 131 (bg-green-nuanced "#092f1f") 132 (bg-yellow-nuanced "#381d0f") 133 (bg-blue-nuanced "#12154a") 134 (bg-magenta-nuanced "#2f0c3f") 135 (bg-cyan-nuanced "#042837") 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 (fg-paren-match fg-main) 215 (bg-paren-expression "#453040") 216 (underline-paren-match unspecified) 217 218 ;;; Mappings 219 220 ;;;; General mappings 221 222 (fringe bg-dim) 223 (cursor yellow-intense) 224 225 (keybind blue-cooler) 226 (name blue-cooler) 227 (identifier yellow-faint) 228 229 (err yellow-warmer) 230 (warning yellow) 231 (info blue) 232 233 (underline-err yellow-intense) 234 (underline-warning magenta-faint) 235 (underline-note cyan) 236 237 (bg-prominent-err bg-yellow-intense) 238 (fg-prominent-err fg-main) 239 (bg-prominent-warning bg-magenta-intense) 240 (fg-prominent-warning fg-main) 241 (bg-prominent-note bg-cyan-intense) 242 (fg-prominent-note fg-main) 243 244 (bg-active-argument bg-yellow-nuanced) 245 (fg-active-argument yellow-warmer) 246 (bg-active-value bg-blue-nuanced) 247 (fg-active-value blue-warmer) 248 249 ;;;; Code mappings 250 251 (builtin magenta-warmer) 252 (comment yellow-cooler) 253 (constant blue-cooler) 254 (docstring cyan-faint) 255 (docmarkup magenta-faint) 256 (fnname magenta) 257 (keyword magenta-cooler) 258 (preprocessor red-cooler) 259 (string blue-warmer) 260 (type cyan-cooler) 261 (variable cyan) 262 (rx-construct yellow-cooler) 263 (rx-backslash blue-cooler) 264 265 ;;;; Accent mappings 266 267 (accent-0 blue-cooler) 268 (accent-1 yellow) 269 (accent-2 cyan-cooler) 270 (accent-3 magenta-warmer) 271 272 ;;;; Button mappings 273 274 (fg-button-active fg-main) 275 (fg-button-inactive fg-dim) 276 (bg-button-active bg-active) 277 (bg-button-inactive bg-dim) 278 279 ;;;; Completion mappings 280 281 (fg-completion-match-0 blue-cooler) 282 (fg-completion-match-1 yellow) 283 (fg-completion-match-2 cyan-cooler) 284 (fg-completion-match-3 magenta-warmer) 285 (bg-completion-match-0 unspecified) 286 (bg-completion-match-1 unspecified) 287 (bg-completion-match-2 unspecified) 288 (bg-completion-match-3 unspecified) 289 290 ;;;; Date mappings 291 292 (date-common cyan) 293 (date-deadline yellow-warmer) 294 (date-event fg-alt) 295 (date-holiday yellow-warmer) 296 (date-holiday-other blue) 297 (date-now fg-main) 298 (date-range fg-alt) 299 (date-scheduled yellow-cooler) 300 (date-weekday cyan) 301 (date-weekend yellow-faint) 302 303 ;;;; Line number mappings 304 305 (fg-line-number-inactive fg-dim) 306 (fg-line-number-active fg-main) 307 (bg-line-number-inactive bg-dim) 308 (bg-line-number-active bg-active) 309 310 ;;;; Link mappings 311 312 (fg-link blue-warmer) 313 (bg-link unspecified) 314 (underline-link blue-warmer) 315 316 (fg-link-symbolic cyan) 317 (bg-link-symbolic unspecified) 318 (underline-link-symbolic cyan) 319 320 (fg-link-visited yellow-faint) 321 (bg-link-visited unspecified) 322 (underline-link-visited yellow-faint) 323 324 ;;;; Mail mappings 325 326 (mail-cite-0 blue-warmer) 327 (mail-cite-1 yellow-cooler) 328 (mail-cite-2 cyan-faint) 329 (mail-cite-3 yellow) 330 (mail-part blue) 331 (mail-recipient blue) 332 (mail-subject yellow-warmer) 333 (mail-other cyan-faint) 334 335 ;;;; Mark mappings 336 337 (bg-mark-delete bg-yellow-subtle) 338 (fg-mark-delete yellow) 339 (bg-mark-select bg-cyan-subtle) 340 (fg-mark-select cyan) 341 (bg-mark-other bg-magenta-subtle) 342 (fg-mark-other magenta-warmer) 343 344 ;;;; Prompt mappings 345 346 (fg-prompt blue) 347 (bg-prompt unspecified) 348 349 ;;;; Prose mappings 350 351 (bg-prose-block-delimiter bg-dim) 352 (fg-prose-block-delimiter fg-dim) 353 (bg-prose-block-contents bg-dim) 354 355 (bg-prose-code unspecified) 356 (fg-prose-code cyan-cooler) 357 358 (bg-prose-macro unspecified) 359 (fg-prose-macro magenta-cooler) 360 361 (bg-prose-verbatim unspecified) 362 (fg-prose-verbatim magenta-warmer) 363 364 (prose-done blue) 365 (prose-todo yellow-warmer) 366 367 (prose-metadata fg-dim) 368 (prose-metadata-value fg-alt) 369 370 (prose-table fg-alt) 371 (prose-table-formula yellow-warmer) 372 373 (prose-tag magenta-faint) 374 375 ;;;; Rainbow mappings 376 377 (rainbow-0 yellow-warmer) 378 (rainbow-1 blue) 379 (rainbow-2 yellow-cooler) 380 (rainbow-3 blue-warmer) 381 (rainbow-4 yellow) 382 (rainbow-5 cyan-warmer) 383 (rainbow-6 yellow-faint) 384 (rainbow-7 blue-faint) 385 (rainbow-8 magenta-faint) 386 387 ;;;; Search mappings 388 389 (bg-search-current bg-yellow-intense) 390 (bg-search-lazy bg-blue-intense) 391 (bg-search-replace bg-magenta-intense) 392 393 (bg-search-rx-group-0 bg-cyan-intense) 394 (bg-search-rx-group-1 bg-magenta-intense) 395 (bg-search-rx-group-2 bg-blue-subtle) 396 (bg-search-rx-group-3 bg-yellow-subtle) 397 398 ;;;; Space mappings 399 400 (bg-space unspecified) 401 (fg-space border) 402 (bg-space-err bg-yellow-intense) 403 404 ;;;; Terminal mappings 405 406 (bg-term-black "#000000") 407 (fg-term-black "#000000") 408 (bg-term-black-bright "#595959") 409 (fg-term-black-bright "#595959") 410 411 (bg-term-red red) 412 (fg-term-red red) 413 (bg-term-red-bright red-warmer) 414 (fg-term-red-bright red-warmer) 415 416 (bg-term-green green) 417 (fg-term-green green) 418 (bg-term-green-bright green-cooler) 419 (fg-term-green-bright green-cooler) 420 421 (bg-term-yellow yellow) 422 (fg-term-yellow yellow) 423 (bg-term-yellow-bright yellow-warmer) 424 (fg-term-yellow-bright yellow-warmer) 425 426 (bg-term-blue blue) 427 (fg-term-blue blue) 428 (bg-term-blue-bright blue-warmer) 429 (fg-term-blue-bright blue-warmer) 430 431 (bg-term-magenta magenta) 432 (fg-term-magenta magenta) 433 (bg-term-magenta-bright magenta-cooler) 434 (fg-term-magenta-bright magenta-cooler) 435 436 (bg-term-cyan cyan) 437 (fg-term-cyan cyan) 438 (bg-term-cyan-bright cyan-cooler) 439 (fg-term-cyan-bright cyan-cooler) 440 441 (bg-term-white "#a6a6a6") 442 (fg-term-white "#a6a6a6") 443 (bg-term-white-bright "#ffffff") 444 (fg-term-white-bright "#ffffff") 445 446 ;;;; Heading mappings 447 448 (fg-heading-0 cyan-cooler) 449 (fg-heading-1 fg-main) 450 (fg-heading-2 yellow-faint) 451 (fg-heading-3 blue-faint) 452 (fg-heading-4 magenta) 453 (fg-heading-5 green-faint) 454 (fg-heading-6 red-faint) 455 (fg-heading-7 cyan-faint) 456 (fg-heading-8 fg-dim) 457 458 (bg-heading-0 unspecified) 459 (bg-heading-1 unspecified) 460 (bg-heading-2 unspecified) 461 (bg-heading-3 unspecified) 462 (bg-heading-4 unspecified) 463 (bg-heading-5 unspecified) 464 (bg-heading-6 unspecified) 465 (bg-heading-7 unspecified) 466 (bg-heading-8 unspecified) 467 468 (overline-heading-0 unspecified) 469 (overline-heading-1 unspecified) 470 (overline-heading-2 unspecified) 471 (overline-heading-3 unspecified) 472 (overline-heading-4 unspecified) 473 (overline-heading-5 unspecified) 474 (overline-heading-6 unspecified) 475 (overline-heading-7 unspecified) 476 (overline-heading-8 unspecified)) 477 "The entire palette of the `modus-vivendi-deuteranopia' theme. 478 479 Named colors have the form (COLOR-NAME HEX-VALUE) with the former 480 as a symbol and the latter as a string. 481 482 Semantic color mappings have the form (MAPPING-NAME COLOR-NAME) 483 with both as symbols. The latter is a named color that already 484 exists in the palette and is associated with a HEX-VALUE.") 485 486 (defcustom modus-vivendi-deuteranopia-palette-overrides nil 487 "Overrides for `modus-vivendi-deuteranopia-palette'. 488 489 Mirror the elements of the aforementioned palette, overriding 490 their value. 491 492 For overrides that are shared across all of the Modus themes, 493 refer to `modus-themes-common-palette-overrides'. 494 495 Theme-specific overrides take precedence over shared overrides. 496 The idea of common overrides is to change semantic color 497 mappings, such as to make the cursor red. Wherea theme-specific 498 overrides can also be used to change the value of a named color, 499 such as what hexadecimal RGB value the red-warmer symbol 500 represents." 501 :group 'modus-themes 502 :package-version '(modus-themes . "4.0.0") 503 :version "30.1" 504 :type '(repeat (list symbol (choice symbol string))) 505 :set #'modus-themes--set-option 506 :initialize #'custom-initialize-default 507 :link '(info-link "(modus-themes) Palette overrides")) 508 509 (modus-themes-theme modus-vivendi-deuteranopia 510 modus-vivendi-deuteranopia-palette 511 modus-vivendi-deuteranopia-palette-overrides) 512 513 (provide-theme 'modus-vivendi-deuteranopia)) 514 515 ;;; modus-vivendi-deuteranopia-theme.el ends here