modus-operandi-tritanopia-theme.el (15087B)
1 ;;; modus-operandi-tritanopia-theme.el --- Tritanopia-optimized theme with a white 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-operandi-tritanopia 47 "Tritanopia-optimized theme with a white background. 48 This variant is optimized for users with blue-yellow color 49 deficiency (tritanopia). 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 'light 55 :kind 'color-scheme 56 :family 'modus) 57 58 (defconst modus-operandi-tritanopia-palette 59 '( 60 ;;; Basic values 61 62 (bg-main "#ffffff") 63 (bg-dim "#f2f2f2") 64 (fg-main "#000000") 65 (fg-dim "#595959") 66 (fg-alt "#193668") 67 (bg-active "#c4c4c4") 68 (bg-inactive "#e0e0e0") 69 (border "#9f9f9f") 70 71 ;;; Common accent foregrounds 72 73 (red "#a60000") 74 (red-warmer "#b21100") 75 (red-cooler "#a0132f") 76 (red-faint "#702000") 77 (red-intense "#d00000") 78 (green "#006800") 79 (green-warmer "#316500") 80 (green-cooler "#00663f") 81 (green-faint "#2a5045") 82 (green-intense "#008900") 83 (yellow "#695500") 84 (yellow-warmer "#973300") 85 (yellow-cooler "#77492f") 86 (yellow-faint "#624416") 87 (yellow-intense "#808000") 88 (blue "#0031a9") 89 (blue-warmer "#3548cf") 90 (blue-cooler "#0000b0") 91 (blue-faint "#003497") 92 (blue-intense "#0000ff") 93 (magenta "#721045") 94 (magenta-warmer "#8f0075") 95 (magenta-cooler "#531ab6") 96 (magenta-faint "#7c318f") 97 (magenta-intense "#cd22bd") 98 (cyan "#005e8b") 99 (cyan-warmer "#3f578f") 100 (cyan-cooler "#005f5f") 101 (cyan-faint "#004f5f") 102 (cyan-intense "#008899") 103 104 ;;; Uncommon accent foregrounds 105 106 (rust "#8a290f") 107 (gold "#80601f") 108 (olive "#56692d") 109 (slate "#2f3f83") 110 (indigo "#4a3a8a") 111 (maroon "#731c52") 112 (pink "#7b435c") 113 114 ;;; Common accent backgrounds 115 116 (bg-red-intense "#ff8f88") 117 (bg-green-intense "#8adf80") 118 (bg-yellow-intense "#f3d000") 119 (bg-blue-intense "#bfc9ff") 120 (bg-magenta-intense "#dfa0f0") 121 (bg-cyan-intense "#a4d5f9") 122 123 (bg-red-subtle "#ffcfbf") 124 (bg-green-subtle "#b3fabf") 125 (bg-yellow-subtle "#fff576") 126 (bg-blue-subtle "#ccdfff") 127 (bg-magenta-subtle "#ffddff") 128 (bg-cyan-subtle "#bfefff") 129 130 (bg-red-nuanced "#ffe8e8") 131 (bg-green-nuanced "#e0f6e0") 132 (bg-yellow-nuanced "#f8f0d0") 133 (bg-blue-nuanced "#ecedff") 134 (bg-magenta-nuanced "#f8e6f5") 135 (bg-cyan-nuanced "#e0f2fa") 136 137 ;;; Uncommon accent backgrounds 138 139 (bg-ochre "#f0e0cc") 140 (bg-lavender "#dfdbfa") 141 (bg-sage "#c0e7d4") 142 143 ;;; Graphs 144 145 (bg-graph-red-0 "#ef7969") 146 (bg-graph-red-1 "#ffaab4") 147 (bg-graph-green-0 "#70c3b0") 148 (bg-graph-green-1 "#a3dfe5") 149 (bg-graph-yellow-0 "#d99f9f") 150 (bg-graph-yellow-1 "#ffb58f") 151 (bg-graph-blue-0 "#80a0df") 152 (bg-graph-blue-1 "#9fcaff") 153 (bg-graph-magenta-0 "#efafcf") 154 (bg-graph-magenta-1 "#ffdaef") 155 (bg-graph-cyan-0 "#7fd3ed") 156 (bg-graph-cyan-1 "#afefff") 157 158 ;;; Special purpose 159 160 (bg-completion "#afdfef") 161 (bg-hover "#ffafbc") 162 (bg-hover-secondary "#9fdfff") 163 (bg-hl-line "#dfeaec") 164 (bg-region "#bdbdbd") 165 (fg-region "#000000") 166 167 (bg-char-0 "#ff908f") 168 (bg-char-1 "#bfbfff") 169 (bg-char-2 "#5fcfdf") 170 171 (bg-mode-line-active "#afe0f2") 172 (fg-mode-line-active "#0f0f0f") 173 (border-mode-line-active "#2f4f44") 174 (bg-mode-line-inactive "#e6e6e6") 175 (fg-mode-line-inactive "#585858") 176 (border-mode-line-inactive "#a3a3a3") 177 178 (modeline-err "#8f0000") 179 (modeline-warning "#6f306f") 180 (modeline-info "#00445f") 181 182 (bg-tab-bar "#dfdfdf") 183 (bg-tab-current "#ffffff") 184 (bg-tab-other "#c2c2c2") 185 186 ;;; Diffs 187 188 (bg-added "#b5e7ff") 189 (bg-added-faint "#c6f6ff") 190 (bg-added-refine "#9adcef") 191 (bg-added-fringe "#1782cc") 192 (fg-added "#005079") 193 (fg-added-intense "#0043aa") 194 195 (bg-changed "#eecfdf") 196 (bg-changed-faint "#f0dde5") 197 (bg-changed-refine "#e0b0d0") 198 (bg-changed-fringe "#9f6ab0") 199 (fg-changed "#6f1343") 200 (fg-changed-intense "#7f0f9f") 201 202 (bg-removed "#ffd8d5") 203 (bg-removed-faint "#ffe9e9") 204 (bg-removed-refine "#f3b5af") 205 (bg-removed-fringe "#d84a4f") 206 (fg-removed "#8f1313") 207 (fg-removed-intense "#aa2222") 208 209 (bg-diff-context "#f3f3f3") 210 211 ;;; Paren match 212 213 (bg-paren-match "#5fcfff") 214 (fg-paren-match fg-main) 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 (bg-active-argument bg-red-nuanced) 245 (fg-active-argument red-warmer) 246 (bg-active-value bg-cyan-nuanced) 247 (fg-active-value cyan) 248 249 ;;;; Code mappings 250 251 (builtin magenta) 252 (comment red-faint) 253 (constant green-cooler) 254 (docstring fg-alt) 255 (docmarkup magenta-faint) 256 (fnname cyan-warmer) 257 (keyword red-cooler) 258 (preprocessor red-warmer) 259 (string cyan) 260 (type blue-warmer) 261 (variable cyan-cooler) 262 (rx-construct red) 263 (rx-backslash magenta) 264 265 ;;;; Accent mappings 266 267 (accent-0 cyan) 268 (accent-1 red-warmer) 269 (accent-2 cyan-cooler) 270 (accent-3 magenta) 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 cyan) 282 (fg-completion-match-1 red-warmer) 283 (fg-completion-match-2 magenta) 284 (fg-completion-match-3 cyan-cooler) 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-cooler) 293 (date-deadline red) 294 (date-event fg-alt) 295 (date-holiday red) 296 (date-holiday-other cyan) 297 (date-now fg-main) 298 (date-range fg-alt) 299 (date-scheduled magenta) 300 (date-weekday cyan) 301 (date-weekend red-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 cyan) 313 (bg-link unspecified) 314 (underline-link cyan) 315 316 (fg-link-symbolic cyan-cooler) 317 (bg-link-symbolic unspecified) 318 (underline-link-symbolic cyan-cooler) 319 320 (fg-link-visited magenta) 321 (bg-link-visited unspecified) 322 (underline-link-visited magenta) 323 324 ;;;; Mail mappings 325 326 (mail-cite-0 cyan-faint) 327 (mail-cite-1 red-faint) 328 (mail-cite-2 magenta-warmer) 329 (mail-cite-3 cyan-warmer) 330 (mail-part cyan-cooler) 331 (mail-recipient cyan) 332 (mail-subject red-cooler) 333 (mail-other cyan) 334 335 ;;;; Mark mappings 336 337 (bg-mark-delete bg-red-subtle) 338 (fg-mark-delete red) 339 (bg-mark-select bg-cyan-subtle) 340 (fg-mark-select cyan) 341 (bg-mark-other bg-magenta-subtle) 342 (fg-mark-other magenta) 343 344 ;;;; Prompt mappings 345 346 (fg-prompt cyan-cooler) 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) 357 358 (bg-prose-macro unspecified) 359 (fg-prose-macro red-warmer) 360 361 (bg-prose-verbatim unspecified) 362 (fg-prose-verbatim magenta-warmer) 363 364 (prose-done cyan) 365 (prose-todo red) 366 367 (prose-metadata fg-dim) 368 (prose-metadata-value fg-alt) 369 370 (prose-table fg-alt) 371 (prose-table-formula red-cooler) 372 373 (prose-tag magenta-faint) 374 375 ;;;; Rainbow mappings 376 377 (rainbow-0 cyan) 378 (rainbow-1 red) 379 (rainbow-2 cyan-warmer) 380 (rainbow-3 red-cooler) 381 (rainbow-4 cyan-cooler) 382 (rainbow-5 magenta) 383 (rainbow-6 cyan-faint) 384 (rainbow-7 magenta-faint) 385 (rainbow-8 red-faint) 386 387 ;;;; Search mappings 388 389 (bg-search-current bg-red-intense) 390 (bg-search-lazy bg-cyan-intense) 391 (bg-search-replace bg-magenta-intense) 392 393 (bg-search-rx-group-0 bg-blue-intense) 394 (bg-search-rx-group-1 bg-magenta-intense) 395 (bg-search-rx-group-2 bg-cyan-subtle) 396 (bg-search-rx-group-3 bg-red-subtle) 397 398 ;;;; Space mappings 399 400 (bg-space unspecified) 401 (fg-space border) 402 (bg-space-err bg-red-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 red-faint) 451 (fg-heading-3 cyan-faint) 452 (fg-heading-4 magenta) 453 (fg-heading-5 green-faint) 454 (fg-heading-6 magenta-faint) 455 (fg-heading-7 cyan-warmer) 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-operandi-tritanopia' 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-operandi-tritanopia-palette-overrides nil 487 "Overrides for `modus-operandi-tritanopia-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-operandi-tritanopia 510 modus-operandi-tritanopia-palette 511 modus-operandi-tritanopia-palette-overrides) 512 513 (provide-theme 'modus-operandi-tritanopia)) 514 515 ;;; modus-operandi-tritanopia-theme.el ends here