modus-operandi-tritanopia-theme.el (14382B)
1 ;;; modus-operandi-tritanopia-theme.el --- Tritanopia-optimized theme with a white 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 ;; Keywords: faces, theme, accessibility 10 11 ;; This file is part of GNU Emacs. 12 13 ;; GNU Emacs is free software: you can redistribute it and/or modify 14 ;; it under the terms of the GNU General Public License as published by 15 ;; the Free Software Foundation, either version 3 of the License, or 16 ;; (at your option) any later version. 17 ;; 18 ;; GNU Emacs is distributed in the hope that it will be useful, 19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 ;; GNU General Public License for more details. 22 ;; 23 ;; You should have received a copy of the GNU General Public License 24 ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. 25 26 ;;; Commentary: 27 ;; 28 ;; The Modus themes conform with the highest standard for 29 ;; color-contrast accessibility between background and foreground 30 ;; values (WCAG AAA). Please refer to the official Info manual for 31 ;; further documentation (distributed with the themes, or available 32 ;; at: <https://protesilaos.com/emacs/modus-themes>). 33 34 ;;; Code: 35 36 37 38 (eval-and-compile 39 (unless (and (fboundp 'require-theme) 40 load-file-name 41 (equal (file-name-directory load-file-name) 42 (expand-file-name "themes/" data-directory)) 43 (require-theme 'modus-themes t)) 44 (require 'modus-themes)) 45 46 ;;;###theme-autoload 47 (deftheme modus-operandi-tritanopia 48 "Tritanopia-optimized theme with a white background. 49 This variant is optimized for users with blue-yellow color 50 deficiency (tritanopia). It conforms with the highest 51 legibility standard for color contrast between background and 52 foreground in any given piece of text, which corresponds to a 53 minimum contrast in relative luminance of 7:1 (WCAG AAA 54 standard)." 55 :background-mode 'light 56 :kind 'color-scheme 57 :family 'modus) 58 59 (defconst modus-operandi-tritanopia-palette 60 '( 61 ;;; Basic values 62 63 (bg-main "#ffffff") 64 (bg-dim "#f2f2f2") 65 (fg-main "#000000") 66 (fg-dim "#595959") 67 (fg-alt "#193668") 68 (bg-active "#c4c4c4") 69 (bg-inactive "#e0e0e0") 70 (border "#9f9f9f") 71 72 ;;; Common accent foregrounds 73 74 (red "#a60000") 75 (red-warmer "#b21100") 76 (red-cooler "#a0132f") 77 (red-faint "#702000") 78 (red-intense "#d00000") 79 (green "#006800") 80 (green-warmer "#316500") 81 (green-cooler "#00663f") 82 (green-faint "#2a5045") 83 (green-intense "#008900") 84 (yellow "#695500") 85 (yellow-warmer "#973300") 86 (yellow-cooler "#77492f") 87 (yellow-faint "#624416") 88 (yellow-intense "#808000") 89 (blue "#0031a9") 90 (blue-warmer "#3548cf") 91 (blue-cooler "#0000b0") 92 (blue-faint "#003497") 93 (blue-intense "#0000ff") 94 (magenta "#721045") 95 (magenta-warmer "#8f0075") 96 (magenta-cooler "#531ab6") 97 (magenta-faint "#7c318f") 98 (magenta-intense "#cd22bd") 99 (cyan "#005e8b") 100 (cyan-warmer "#3f578f") 101 (cyan-cooler "#005f5f") 102 (cyan-faint "#004f5f") 103 (cyan-intense "#008899") 104 105 ;;; Uncommon accent foregrounds 106 107 (rust "#8a290f") 108 (gold "#80601f") 109 (olive "#56692d") 110 (slate "#2f3f83") 111 (indigo "#4a3a8a") 112 (maroon "#731c52") 113 (pink "#7b435c") 114 115 ;;; Common accent backgrounds 116 117 (bg-red-intense "#ff8f88") 118 (bg-green-intense "#8adf80") 119 (bg-yellow-intense "#f3d000") 120 (bg-blue-intense "#bfc9ff") 121 (bg-magenta-intense "#dfa0f0") 122 (bg-cyan-intense "#a4d5f9") 123 124 (bg-red-subtle "#ffcfbf") 125 (bg-green-subtle "#b3fabf") 126 (bg-yellow-subtle "#fff576") 127 (bg-blue-subtle "#ccdfff") 128 (bg-magenta-subtle "#ffddff") 129 (bg-cyan-subtle "#bfefff") 130 131 (bg-red-nuanced "#fff1f0") 132 (bg-green-nuanced "#ecf7ed") 133 (bg-yellow-nuanced "#fff3da") 134 (bg-blue-nuanced "#f3f3ff") 135 (bg-magenta-nuanced "#fdf0ff") 136 (bg-cyan-nuanced "#ebf6fa") 137 138 ;;; Uncommon accent backgrounds 139 140 (bg-ochre "#f0e0cc") 141 (bg-lavender "#dfdbfa") 142 (bg-sage "#c0e7d4") 143 144 ;;; Graphs 145 146 (bg-graph-red-0 "#ef7969") 147 (bg-graph-red-1 "#ffaab4") 148 (bg-graph-green-0 "#70c3b0") 149 (bg-graph-green-1 "#a3dfe5") 150 (bg-graph-yellow-0 "#d99f9f") 151 (bg-graph-yellow-1 "#ffb58f") 152 (bg-graph-blue-0 "#80a0df") 153 (bg-graph-blue-1 "#9fcaff") 154 (bg-graph-magenta-0 "#efafcf") 155 (bg-graph-magenta-1 "#ffdaef") 156 (bg-graph-cyan-0 "#7fd3ed") 157 (bg-graph-cyan-1 "#afefff") 158 159 ;;; Special purpose 160 161 (bg-completion "#afdfef") 162 (bg-hover "#ffafbc") 163 (bg-hover-secondary "#9fdfff") 164 (bg-hl-line "#dfeaec") 165 (bg-region "#bdbdbd") 166 (fg-region "#000000") 167 168 (bg-char-0 "#ff908f") 169 (bg-char-1 "#bfbfff") 170 (bg-char-2 "#5fcfdf") 171 172 (bg-mode-line-active "#afe0f2") 173 (fg-mode-line-active "#0f0f0f") 174 (border-mode-line-active "#2f4f44") 175 (bg-mode-line-inactive "#e6e6e6") 176 (fg-mode-line-inactive "#585858") 177 (border-mode-line-inactive "#a3a3a3") 178 179 (modeline-err "#8f0000") 180 (modeline-warning "#6f306f") 181 (modeline-info "#00445f") 182 183 (bg-tab-bar "#dfdfdf") 184 (bg-tab-current "#ffffff") 185 (bg-tab-other "#c2c2c2") 186 187 ;;; Diffs 188 189 (bg-added "#b5e7ff") 190 (bg-added-faint "#c6f6ff") 191 (bg-added-refine "#9adcef") 192 (bg-added-fringe "#1782cc") 193 (fg-added "#005079") 194 (fg-added-intense "#0043aa") 195 196 (bg-changed "#eecfdf") 197 (bg-changed-faint "#f0dde5") 198 (bg-changed-refine "#e0b0d0") 199 (bg-changed-fringe "#9f6ab0") 200 (fg-changed "#6f1343") 201 (fg-changed-intense "#7f0f9f") 202 203 (bg-removed "#ffd8d5") 204 (bg-removed-faint "#ffe9e9") 205 (bg-removed-refine "#f3b5af") 206 (bg-removed-fringe "#d84a4f") 207 (fg-removed "#8f1313") 208 (fg-removed-intense "#aa2222") 209 210 (bg-diff-context "#f3f3f3") 211 212 ;;; Paren match 213 214 (bg-paren-match "#5fcfff") 215 (bg-paren-expression "#efd3f5") 216 (underline-paren-match unspecified) 217 218 ;;; Mappings 219 220 ;;;; General mappings 221 222 (fringe bg-dim) 223 (cursor red-intense) 224 225 (keybind red) 226 (name red-cooler) 227 (identifier red-faint) 228 229 (err red-warmer) 230 (warning magenta) 231 (info cyan) 232 233 (underline-err red-intense) 234 (underline-warning magenta-intense) 235 (underline-note cyan-intense) 236 237 (bg-prominent-err bg-red-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 ;;;; Code mappings 245 246 (builtin magenta) 247 (comment red-faint) 248 (constant green-cooler) 249 (docstring fg-alt) 250 (docmarkup magenta-faint) 251 (fnname cyan-warmer) 252 (keyword red-cooler) 253 (preprocessor red-warmer) 254 (string cyan) 255 (type blue-warmer) 256 (variable cyan-cooler) 257 (rx-construct red) 258 (rx-backslash magenta) 259 260 ;;;; Accent mappings 261 262 (accent-0 cyan) 263 (accent-1 red-warmer) 264 (accent-2 cyan-cooler) 265 (accent-3 magenta) 266 267 ;;;; Button mappings 268 269 (fg-button-active fg-main) 270 (fg-button-inactive fg-dim) 271 (bg-button-active bg-active) 272 (bg-button-inactive bg-dim) 273 274 ;;;; Completion mappings 275 276 (fg-completion-match-0 cyan) 277 (fg-completion-match-1 red-warmer) 278 (fg-completion-match-2 magenta) 279 (fg-completion-match-3 cyan-cooler) 280 (bg-completion-match-0 unspecified) 281 (bg-completion-match-1 unspecified) 282 (bg-completion-match-2 unspecified) 283 (bg-completion-match-3 unspecified) 284 285 ;;;; Date mappings 286 287 (date-common cyan-cooler) 288 (date-deadline red) 289 (date-event fg-alt) 290 (date-holiday red) 291 (date-holiday-other cyan) 292 (date-now fg-main) 293 (date-range fg-alt) 294 (date-scheduled magenta) 295 (date-weekday cyan) 296 (date-weekend red-faint) 297 298 ;;;; Line number mappings 299 300 (fg-line-number-inactive fg-dim) 301 (fg-line-number-active fg-main) 302 (bg-line-number-inactive bg-dim) 303 (bg-line-number-active bg-active) 304 305 ;;;; Link mappings 306 307 (fg-link cyan) 308 (bg-link unspecified) 309 (underline-link cyan) 310 311 (fg-link-symbolic cyan-cooler) 312 (bg-link-symbolic unspecified) 313 (underline-link-symbolic cyan-cooler) 314 315 (fg-link-visited magenta) 316 (bg-link-visited unspecified) 317 (underline-link-visited magenta) 318 319 ;;;; Mail mappings 320 321 (mail-cite-0 cyan-faint) 322 (mail-cite-1 red-faint) 323 (mail-cite-2 magenta-warmer) 324 (mail-cite-3 cyan-warmer) 325 (mail-part cyan-cooler) 326 (mail-recipient cyan) 327 (mail-subject red-cooler) 328 (mail-other cyan) 329 330 ;;;; Mark mappings 331 332 (bg-mark-delete bg-red-subtle) 333 (fg-mark-delete red) 334 (bg-mark-select bg-cyan-subtle) 335 (fg-mark-select cyan) 336 (bg-mark-other bg-magenta-subtle) 337 (fg-mark-other magenta) 338 339 ;;;; Prompt mappings 340 341 (fg-prompt cyan-cooler) 342 (bg-prompt unspecified) 343 344 ;;;; Prose mappings 345 346 (prose-block fg-dim) 347 (prose-code cyan) 348 (prose-done cyan) 349 (prose-macro red-warmer) 350 (prose-metadata fg-dim) 351 (prose-metadata-value fg-alt) 352 (prose-table fg-alt) 353 (prose-tag fg-alt) 354 (prose-todo red) 355 (prose-verbatim magenta-warmer) 356 357 ;;;; Rainbow mappings 358 359 (rainbow-0 cyan) 360 (rainbow-1 red) 361 (rainbow-2 cyan-warmer) 362 (rainbow-3 red-cooler) 363 (rainbow-4 cyan-cooler) 364 (rainbow-5 magenta) 365 (rainbow-6 cyan-faint) 366 (rainbow-7 magenta-faint) 367 (rainbow-8 red-faint) 368 369 ;;;; Space mappings 370 371 (bg-space unspecified) 372 (fg-space border) 373 (bg-space-err bg-red-intense) 374 375 ;;;; Terminal mappings 376 377 (bg-term-black "black") 378 (fg-term-black "black") 379 (bg-term-black-bright "gray35") 380 (fg-term-black-bright "gray35") 381 382 (bg-term-red red) 383 (fg-term-red red) 384 (bg-term-red-bright red-warmer) 385 (fg-term-red-bright red-warmer) 386 387 (bg-term-green green) 388 (fg-term-green green) 389 (bg-term-green-bright green-cooler) 390 (fg-term-green-bright green-cooler) 391 392 (bg-term-yellow yellow) 393 (fg-term-yellow yellow) 394 (bg-term-yellow-bright yellow-warmer) 395 (fg-term-yellow-bright yellow-warmer) 396 397 (bg-term-blue blue) 398 (fg-term-blue blue) 399 (bg-term-blue-bright blue-warmer) 400 (fg-term-blue-bright blue-warmer) 401 402 (bg-term-magenta magenta) 403 (fg-term-magenta magenta) 404 (bg-term-magenta-bright magenta-cooler) 405 (fg-term-magenta-bright magenta-cooler) 406 407 (bg-term-cyan cyan) 408 (fg-term-cyan cyan) 409 (bg-term-cyan-bright cyan-cooler) 410 (fg-term-cyan-bright cyan-cooler) 411 412 (bg-term-white "gray65") 413 (fg-term-white "gray65") 414 (bg-term-white-bright "white") 415 (fg-term-white-bright "white") 416 417 ;;;; Heading mappings 418 419 (fg-heading-0 cyan-cooler) 420 (fg-heading-1 fg-main) 421 (fg-heading-2 red-faint) 422 (fg-heading-3 cyan-faint) 423 (fg-heading-4 magenta) 424 (fg-heading-5 green-faint) 425 (fg-heading-6 magenta-faint) 426 (fg-heading-7 cyan-warmer) 427 (fg-heading-8 fg-dim) 428 429 (bg-heading-0 unspecified) 430 (bg-heading-1 unspecified) 431 (bg-heading-2 unspecified) 432 (bg-heading-3 unspecified) 433 (bg-heading-4 unspecified) 434 (bg-heading-5 unspecified) 435 (bg-heading-6 unspecified) 436 (bg-heading-7 unspecified) 437 (bg-heading-8 unspecified) 438 439 (overline-heading-0 unspecified) 440 (overline-heading-1 unspecified) 441 (overline-heading-2 unspecified) 442 (overline-heading-3 unspecified) 443 (overline-heading-4 unspecified) 444 (overline-heading-5 unspecified) 445 (overline-heading-6 unspecified) 446 (overline-heading-7 unspecified) 447 (overline-heading-8 unspecified)) 448 "The entire palette of the `modus-operandi-tritanopia' theme. 449 450 Named colors have the form (COLOR-NAME HEX-VALUE) with the former 451 as a symbol and the latter as a string. 452 453 Semantic color mappings have the form (MAPPING-NAME COLOR-NAME) 454 with both as symbols. The latter is a named color that already 455 exists in the palette and is associated with a HEX-VALUE.") 456 457 (defcustom modus-operandi-tritanopia-palette-overrides nil 458 "Overrides for `modus-operandi-tritanopia-palette'. 459 460 Mirror the elements of the aforementioned palette, overriding 461 their value. 462 463 For overrides that are shared across all of the Modus themes, 464 refer to `modus-themes-common-palette-overrides'. 465 466 Theme-specific overrides take precedence over shared overrides. 467 The idea of common overrides is to change semantic color 468 mappings, such as to make the cursor red. Wherea theme-specific 469 overrides can also be used to change the value of a named color, 470 such as what hexadecimal RGB value the red-warmer symbol 471 represents." 472 :group 'modus-themes 473 :package-version '(modus-themes . "4.0.0") 474 :version "30.1" 475 :type '(repeat (list symbol (choice symbol string))) 476 :set #'modus-themes--set-option 477 :initialize #'custom-initialize-default 478 :link '(info-link "(modus-themes) Palette overrides")) 479 480 (modus-themes-theme modus-operandi-tritanopia 481 modus-operandi-tritanopia-palette 482 modus-operandi-tritanopia-palette-overrides) 483 484 (provide-theme 'modus-operandi-tritanopia)) 485 486 ;;; modus-operandi-tritanopia-theme.el ends here