Add deuteranopia THEMES; remove the user option

Providing bespoke themes gives us the freedom to implement changes
wherever necessary without making the code more complex.  The now
discontinued 'modus-themes-deuteranopia' was a user option with
limited scope: it simply replaced green with blue in some contexts.
But a proper design for deuteranopia requires more than that.  These
new themes are the right solution and I am sure the people who need
them will greatly appreciate them.
This commit is contained in:
Protesilaos Stavrou 2022-12-16 05:54:13 +02:00
parent a736eebd67
commit 1b4238f51d
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA
8 changed files with 585 additions and 172 deletions

View file

@ -84,6 +84,8 @@ To ensure that users have a consistently accessible experience, the
themes strive to achieve as close to full face coverage as possible
([[#h:a9c8f29d-7f72-4b54-b74b-ddefe15d6a19][Face coverage]]).
# TODO 2022-12-16: Update "overview" reference to deueteranopia.
Furthermore, the themes are designed to empower users with red-green
color deficiency (deuteranopia). This is achieved in three ways:
@ -470,7 +472,6 @@ this manual.
modus-themes-bold-constructs nil
modus-themes-mixed-fonts nil
modus-themes-subtle-line-numbers nil
modus-themes-deuteranopia t
modus-themes-variable-pitch-ui nil
modus-themes-custom-auto-reload t
@ -549,41 +550,6 @@ UI or related functions such as ~customize-set-variable~ and ~setopt~
With a nil value, changes to user options have no further consequences:
the user must manually reload the theme ([[#h:3f3c3728-1b34-437d-9d0c-b110f5b161a9][Enable and load]]).
** Option for red-green color deficiency or deuteranopia
:properties:
:alt_title: Deuteranopia style
:description: Toggle red/blue color-coding instead of red/green
:custom_id: h:3ed03a48-20d8-4ce7-b214-0eb7e4c79abe
:end:
#+vindex: modus-themes-deuteranopia
Brief: When non-~nil~ use red/blue color-coding instead of red/green,
where appropriate.
Symbol: ~modus-themes-deuteranopia~ (=boolean= type)
Possible values:
1. ~nil~ (default)
2. ~t~
This is to account for red-green color deficiency, also know as
deuteranopia and variants. It applies to all contexts where there can
be a color-coded distinction between failure or success, a to-do or done
state, a mark for deletion versus a mark for selection (e.g. in Dired),
current and lazily highlighted search matches, removed lines in diffs as
opposed to added ones, and so on.
Note that this does not change all colors throughout the active theme,
but only applies to cases that have color-coding significance. For
example, regular code syntax highlighting is not affected. There is no
such need because of the themes' overarching commitment to the highest
legibility standard, which ensures that text is readable regardless of
hue, as well as the predominance of colors on the
blue-cyan-magenta-purple side of the spectrum.
[[#h:0b26cb47-9733-4cb1-87d9-50850cb0386e][Why are colors mostly variants of blue, magenta, cyan?]].
** Option for more bold constructs
:properties:
:alt_title: Bold constructs
@ -2401,6 +2367,8 @@ need to (provided they understand the implications).
:end:
#+cindex: Foreground-only diffs
# TODO 2022-12-16: Review diff DIY for deuteranopia.
Buffers that show differences between versions of a file or buffer, such
as in ~diff-mode~ and ~ediff~ always use color-coded background and
foreground combinations.
@ -3092,6 +3060,8 @@ length elsewhere in this manual:
[[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Face specs at scale using the themes' palette]].
# TODO 2022-12-16: Review git-gutter DIY for deuteranopia.
#+begin_src emacs-lisp
(defun my-modus-themes-custom-faces ()
(modus-themes-with-colors
@ -4107,10 +4077,12 @@ standards are not compromised and (ii) the overall character of the
themes remains consistent.
The former criterion should be crystal clear as it pertains to the
scientific foundations of the themes: high legibility and taking care of
the needs of users with red-green color deficiency (deuteranopia) by
avoiding red+green color coding paradigms and/or by providing red+blue
variants.
scientific foundations of the themes: high legibility and taking care
of the needs of users with red-green color deficiency (deuteranopia)
by avoiding red+green color coding paradigms and/or by providing
yellow+blue variants.
# TODO 2022-12-16: Add reference to deuteranopia themes to above paragraph.
The latter criterion is the "je ne sais quoi" of the artistic aspect of
the themes, which is partially fleshed out in this manual.

View file

@ -0,0 +1,254 @@
;;; modus-operandi-deuteranopia-theme.el --- Elegant, highly legible and customizable light theme -*- lexical-binding:t -*-
;; Copyright (C) 2019-2022 Free Software Foundation, Inc.
;; Author: Protesilaos Stavrou <info@protesilaos.com>
;; Maintainer: Modus-Themes Development <~protesilaos/modus-themes@lists.sr.ht>
;; URL: https://git.sr.ht/~protesilaos/modus-themes
;; Mailing-List: https://lists.sr.ht/~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))
(deftheme modus-operandi-deuteranopia
"Elegant, highly legible and customizable light theme.
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).")
(defconst modus-operandi-deuteranopia-palette
'(
;;; Basic values
(bg-main "#ffffff")
(bg-dim "#f0f0f0")
(fg-main "#000000")
(fg-dim "#595959")
(fg-alt "#193668")
(bg-active "#c4c4c4")
(bg-inactive "#e0e0e0")
(border "#9f9f9f")
;;; Common accent foregrounds
(red "#a60000")
(red-warmer "#972500")
(red-cooler "#a0132f")
(red-faint "#7f0000")
(red-intense "#d00000")
(green "#006800")
(green-warmer "#316500")
(green-cooler "#00663f")
(green-faint "#2a5045")
(green-intense "#008900")
(yellow "#6f5500")
(yellow-warmer "#884900")
(yellow-cooler "#7a4f2f")
(yellow-faint "#624416")
(yellow-intense "#808000")
(blue "#0031a9")
(blue-warmer "#354fcf")
(blue-cooler "#0000b0")
(blue-faint "#003497")
(blue-intense "#0000ff")
(magenta "#721045")
(magenta-warmer "#8f0075")
(magenta-cooler "#531ab6")
(magenta-faint "#6f3f7f")
(magenta-intense "#dd22dd")
(cyan "#005e8b")
(cyan-warmer "#3f578f")
(cyan-cooler "#005f5f")
(cyan-faint "#005077")
(cyan-intense "#008899")
;;; Common accent backgrounds
(bg-red "#ff8f88")
(bg-green "#8adf80")
(bg-yellow "#f3d000")
(bg-blue "#bfc9ff")
(bg-magenta "#dfa0f0")
(bg-cyan "#a4d5f9")
(bg-red-subtle "#ffcfbf")
(bg-green-subtle "#b3fabf")
(bg-yellow-subtle "#fff576")
(bg-blue-subtle "#ccdfff")
(bg-magenta-subtle "#ffddff")
(bg-cyan-subtle "#bfefff")
;;; Graphs
(red-graph-0-bg "#ef7969")
(red-graph-1-bg "#ffaab4")
(green-graph-0-bg "#4faa09")
(green-graph-1-bg "#8fef00")
(yellow-graph-0-bg "#ffcf00")
(yellow-graph-1-bg "#f9ff00")
(blue-graph-0-bg "#7090ff")
(blue-graph-1-bg "#9fc6ff")
(magenta-graph-0-bg "#e07fff")
(magenta-graph-1-bg "#fad0ff")
(cyan-graph-0-bg "#70d3f0")
(cyan-graph-1-bg "#afefff")
;;; Special purpose
(bg-completion "#c0deff")
(bg-hover "#94d4ff")
(bg-hover-secondary "#f5d0a0")
(bg-hl-line "#d0d6ec")
(bg-paren-match "#5fcfff")
(bg-paren-expression "#efd3f5")
(bg-region "#bcbcbc")
(bg-region-subtle "#f0e0cc")
(bg-prompt "#ebc580")
(bg-char-0 "#7feaff")
(bg-char-1 "#ffaaff")
(bg-char-2 "#dff000")
;;; Diffs
(bg-added "#d5d5ff")
(bg-added-faint "#e4e4ff")
(bg-added-refine "#b5b5ef")
(bg-added-intense "#579acc")
(fg-added "#333399")
(bg-changed "#eecfdf")
(bg-changed-faint "#f0dde5")
(bg-changed-refine "#e0b0d0")
(bg-changed-intense "#9f7abf")
(fg-changed "#6f1343")
(bg-removed "#fff588")
(bg-removed-faint "#f2f2bb")
(bg-removed-refine "#f0e068")
(bg-removed-intense "#d7c20a")
(fg-removed "#553d00")
;;;; Mappings
(bg-mode-line-active bg-active)
(fg-mode-line-active fg-main)
(border-mode-line-active fg-dim)
(bg-mode-line-inactive bg-inactive)
(fg-mode-line-inactive fg-dim)
(border-mode-line-inactive border)
(cursor fg-main)
(builtin magenta-warmer)
(comment fg-dim)
(constant blue-cooler)
(docstring green-faint)
(fnname magenta)
(keyword magenta-cooler)
(preprocessor red-cooler)
(string blue-warmer)
(type cyan-cooler)
(variable cyan)
(date cyan)
(weekend blue) ; for M-x calendar and Org agenda
(keybind blue-cooler)
(link blue-warmer)
(link-symbolic cyan)
(link-visited yellow-faint)
(name blue-cooler)
(identifier yellow-faint)
(tag magenta-faint)
(prompt cyan-cooler)
(rx-construct yellow-cooler)
(rx-backslash blue-cooler)
(err yellow-warmer)
(warning yellow-cooler)
(info blue)
(underline-err red-intense)
(underline-warning yellow-intense)
(underline-note cyan-intense)
(accent-0 blue)
(accent-1 yellow-warmer)
(accent-2 cyan)
(accent-3 magenta-cooler)
(bg-accent-0 bg-blue-subtle)
(bg-accent-1 bg-yellow-subtle)
(bg-accent-2 bg-cyan-subtle)
(bg-accent-3 bg-magenta-subtle)
(mail-cite-0 blue-warmer)
(mail-cite-1 yellow)
(mail-cite-2 blue-cooler)
(mail-cite-3 yellow-cooler)
(mail-part blue)
(mail-recipient blue)
(mail-subject yellow-warmer)
(mail-other cyan-faint)
(heading-0 cyan-cooler)
(heading-1 fg-main)
(heading-2 yellow-faint)
(heading-3 fg-alt)
(heading-4 magenta)
(heading-5 green-faint)
(heading-6 red-faint)
(heading-7 cyan-warmer)
(heading-8 fg-dim)
(prose-code green-cooler)
(prose-macro magenta-cooler)
(prose-verbatim magenta-warmer))
"The entire palette of the `modus-operandi-deuteranopia' theme.
Each element has the form (NAME HEX) with the former as a
symbol and the latter as a string.")
(defvar modus-operandi-deuteranopia-palette-overrides nil
"Overrides for `modus-operandi-deuteranopia-palette'.")
(modus-themes-theme modus-operandi-deuteranopia modus-operandi-deuteranopia-palette modus-operandi-deuteranopia-palette-overrides)
(provide-theme 'modus-operandi-deuteranopia))
;;;###theme-autoload
(put 'modus-operandi-deuteranopia 'theme-properties '(:background-mode light :kind color-scheme :family modus))
;;; modus-operandi-deuteranopia-theme.el ends here

View file

@ -145,22 +145,16 @@ which corresponds to a minimum contrast in relative luminance of
;;; Diffs
(bg-added "#c1f2d1")
(bg-added-faint "#d8f8e1")
(bg-added-refine "#b1e4c1")
(bg-added-intense "#8cca8c")
(fg-added "#005000")
(bg-added-deuteran "#dbdbff")
(bg-added-faint-deuteran "#e4e4ff")
(bg-added-refine-deuteran "#c0c0ef")
(bg-added-intense-deuteran "#8fcfff")
(fg-added-deuteran "#303399")
(bg-added "#c1f2d1")
(bg-added-faint "#d8f8e1")
(bg-added-refine "#aee5be")
(bg-added-intense "#8cca8c")
(fg-added "#005000")
(bg-changed "#ffdfa9")
(bg-changed-faint "#ffefbf")
(bg-changed-refine "#fac090")
(bg-changed-intense "#dfd23a")
(bg-changed-intense "#d7c20a")
(fg-changed "#553d00")
(bg-removed "#ffd8d5")
@ -206,8 +200,7 @@ which corresponds to a minimum contrast in relative luminance of
(err red)
(warning yellow-warmer)
(success green)
(note cyan)
(info green)
(underline-err red-intense)
(underline-warning yellow-intense)

View file

@ -144,22 +144,16 @@ which corresponds to a minimum contrast in relative luminance of
;;; Diffs
(bg-added "#c1f2d1")
(bg-added-faint "#d8f8e1")
(bg-added-refine "#b1e4c1")
(bg-added-intense "#8cca8c")
(fg-added "#005000")
(bg-added-deuteran "#dbdbff")
(bg-added-faint-deuteran "#e4e4ff")
(bg-added-refine-deuteran "#c0c0ef")
(bg-added-intense-deuteran "#8fcfff")
(fg-added-deuteran "#303399")
(bg-added "#c1f2d1")
(bg-added-faint "#d8f8e1")
(bg-added-refine "#aee5be")
(bg-added-intense "#8cca8c")
(fg-added "#005000")
(bg-changed "#ffdfa9")
(bg-changed-faint "#ffefbf")
(bg-changed-refine "#fac090")
(bg-changed-intense "#dfd23a")
(bg-changed-intense "#d7c20a")
(fg-changed "#553d00")
(bg-removed "#ffd8d5")
@ -205,8 +199,7 @@ which corresponds to a minimum contrast in relative luminance of
(err red)
(warning yellow-warmer)
(success green)
(note cyan)
(info green)
(underline-err red-intense)
(underline-warning yellow-intense)

View file

@ -211,11 +211,6 @@ see `modus-themes-reset-soft'."
"Generic face for command prompts."
:group 'modus-themes-faces)
;; "Grue" is "green" and "blue".
(defface modus-themes-grue nil
"Generic face for `modus-themes-deuteranopia' foreground."
:group 'modus-themes-faces)
(defface modus-themes-completion-selected nil
"Face for current selection in completion UIs."
:group 'modus-themes-faces)
@ -248,6 +243,7 @@ see `modus-themes-reset-soft'."
(make-obsolete-variable 'modus-themes-fringe-blue nil "4.0.0")
(make-obsolete-variable 'modus-themes-fringe-magenta nil "4.0.0")
(make-obsolete-variable 'modus-themes-fringe-cyan nil "4.0.0")
(make-obsolete-variable 'modus-themes-grue nil "4.0.0")
(make-obsolete-variable 'modus-themes-grue-nuanced nil "4.0.0")
(make-obsolete-variable 'modus-themes-red-nuanced nil "4.0.0")
(make-obsolete-variable 'modus-themes-green-nuanced nil "4.0.0")
@ -328,7 +324,8 @@ Will set SYM to VAL, and reload the current theme, unless
(defconst modus-themes-items
'( modus-operandi modus-vivendi
modus-operandi-tinted modus-vivendi-tinted)
modus-operandi-tinted modus-vivendi-tinted
modus-operandi-deuteranopia modus-vivendi-deuteranopia)
"Symbols of the Modus themes.")
(defcustom modus-themes-to-toggle '(modus-operandi modus-vivendi)
@ -857,33 +854,7 @@ In user configuration files the form may look like this:
:initialize #'custom-initialize-default
:link '(info-link "(modus-themes) Active region"))
(defcustom modus-themes-deuteranopia nil
"When non-nil use red/blue color-coding instead of red/green.
This is to account for red-green color deficiency, also know as
deuteranopia and variants. It applies to all contexts where
there can be a color-coded distinction between failure or
success, a to-do or done state, a mark for deletion versus a mark
for selection (e.g. in Dired), current and lazily highlighted
search matches, removed lines in diffs as opposed to added ones,
and so on.
Note that this does not change all colors throughout the active
theme, but only applies to cases that have color-coding
significance. For example, regular code syntax highlighting is
not affected. There is no such need because of the themes'
overarching commitment to the highest legibility standard, which
ensures that text is readable regardless of hue, as well as the
predominance of colors on the blue-cyan-magenta-purple side of
the spectrum."
:group 'modus-themes
:package-version '(modus-themes . "2.0.0")
:version "29.1"
:type 'boolean
:set #'modus-themes--set-option
:initialize #'custom-initialize-default
:link '(info-link "(modus-themes) Deuteranopia style"))
(make-obsolete-variable 'modus-themes-deuteranopia nil "4.0.0")
(make-obsolete-variable 'modus-themes-mail-citations nil "4.0.0")
(make-obsolete-variable 'modus-themes-tabs-accented nil "4.0.0")
(make-obsolete-variable 'modus-themes-box-buttons nil "4.0.0")
@ -1233,12 +1204,6 @@ default text color."
:foreground fg
:extend (if gray t 'unspecified))))
(defun modus-themes--deuteran (deuteran main)
"Determine whether to color-code success as DEUTERAN or MAIN."
(if modus-themes-deuteranopia
(list deuteran)
(list main)))
(defun modus-themes--completion-line (bg fg)
"Styles for `modus-themes-completions' with BG and FG colors."
(let* ((var (modus-themes--list-or-warn 'modus-themes-completions))
@ -1399,7 +1364,6 @@ is a less intense variant of BG."
`(modus-themes-slant ((,c ,@(modus-themes--slant))))
`(modus-themes-ui-variable-pitch ((,c ,@(modus-themes--variable-pitch-ui))))
;;;;; other custom faces
`(modus-themes-grue ((,c :foreground ,@(modus-themes--deuteran blue success))))
`(modus-themes-key-binding ((,c :inherit (bold modus-themes-fixed-pitch) :foreground ,keybind)))
`(modus-themes-prompt ((,c ,@(modus-themes--prompt prompt bg-prompt))))
`(modus-themes-reset-hard ((,c :inherit (fixed-pitch modus-themes-reset-soft)
@ -1449,7 +1413,7 @@ is a less intense variant of BG."
`(secondary-selection ((,c :background ,bg-hover-secondary)))
`(separator-line ((,c :underline ,bg-region)))
`(shadow ((,c :foreground ,fg-dim)))
`(success ((,c :inherit (bold modus-themes-grue))))
`(success ((,c :inherit bold :foreground ,info)))
`(trailing-whitespace ((,c :background ,bg-red)))
`(warning ((,c :inherit bold :foreground ,warning)))
;;;;; buttons, links, widgets
@ -1686,7 +1650,7 @@ is a less intense variant of BG."
`(cider-enlightened-face ((,c :box ,warning)))
`(cider-enlightened-local-face ((,c :inherit warning)))
`(cider-error-highlight-face ((,c :inherit modus-themes-lang-error)))
`(cider-fringe-good-face ((,c :inherit modus-themes-grue)))
`(cider-fringe-good-face ((,c :foreground ,info)))
`(cider-instrumented-face ((,c :box ,err)))
`(cider-reader-conditional-face ((,c :inherit font-lock-type-face)))
`(cider-repl-prompt-face ((,c :inherit minibuffer-prompt)))
@ -1729,11 +1693,11 @@ is a less intense variant of BG."
;;;;; compilation
`(compilation-column-number ((,c :inherit compilation-line-number)))
`(compilation-error ((,c :inherit modus-themes-bold :foreground ,err)))
`(compilation-info ((,c :inherit modus-themes-bold :foreground ,note)))
`(compilation-info ((,c :inherit modus-themes-bold :foreground ,info)))
`(compilation-line-number ((,c :inherit shadow)))
`(compilation-mode-line-exit ((,c :inherit bold)))
`(compilation-mode-line-fail ((,c :inherit modus-themes-bold :foreground ,err)))
`(compilation-mode-line-run ((,c :inherit modus-themes-bold :foreground ,note)))
`(compilation-mode-line-run ((,c :inherit modus-themes-bold :foreground ,info)))
`(compilation-warning ((,c :inherit modus-themes-bold :foreground ,warning)))
;;;;; completions
`(completions-annotations ((,c :inherit modus-themes-slant :foreground ,docstring)))
@ -1819,14 +1783,14 @@ is a less intense variant of BG."
;;;;; diff-hl
`(diff-hl-change ((,c :background ,bg-changed-intense)))
`(diff-hl-delete ((,c :background ,bg-removed-intense)))
`(diff-hl-insert ((,c :background ,@(modus-themes--deuteran bg-added-intense-deuteran bg-added-intense))))
`(diff-hl-insert ((,c :background ,bg-added-intense)))
`(diff-hl-reverted-hunk-highlight ((,c :background ,fg-main :foreground ,bg-main)))
;;;;; diff-mode
`(diff-added ((,c :background ,@(modus-themes--deuteran bg-added-deuteran bg-added))))
`(diff-added ((,c :background ,bg-added)))
`(diff-changed ((,c :background ,bg-changed :extend t)))
`(diff-changed-unspecified ((,c :inherit diff-changed)))
`(diff-removed ((,c :background ,bg-removed)))
`(diff-refine-added ((,c :background ,@(modus-themes--deuteran bg-added-refine-deuteran bg-added-refine))))
`(diff-refine-added ((,c :background ,bg-added-refine)))
`(diff-refine-changed ((,c :background ,bg-changed-refine)))
`(diff-refine-removed ((,c :background ,bg-removed-refine)))
`(diff-indicator-added ((,c :inherit (success diff-added))))
@ -1906,7 +1870,7 @@ is a less intense variant of BG."
;;;;; doom-modeline
`(doom-modeline-bar ((,c :background ,blue)))
`(doom-modeline-bar-inactive ((,c :background "gray50")))
`(doom-modeline-battery-charging ((,c :foreground ,success)))
`(doom-modeline-battery-charging ((,c :foreground ,info)))
`(doom-modeline-battery-critical ((,c :underline t :foreground ,err)))
`(doom-modeline-battery-error ((,c :underline t :foreground ,err)))
`(doom-modeline-battery-full (( )))
@ -1917,7 +1881,7 @@ is a less intense variant of BG."
`(doom-modeline-buffer-modified ((,c :foreground ,err)))
`(doom-modeline-buffer-path (( )))
`(doom-modeline-evil-emacs-state ((,c :inherit italic)))
`(doom-modeline-evil-insert-state ((,c :foreground ,note)))
`(doom-modeline-evil-insert-state ((,c :foreground ,info)))
`(doom-modeline-evil-motion-state (( )))
`(doom-modeline-evil-normal-state (( )))
`(doom-modeline-evil-operator-state ((,c :inherit bold)))
@ -2041,7 +2005,7 @@ is a less intense variant of BG."
`(epa-validity-disabled ((,c :foreground ,err)))
`(epa-validity-high ((,c :inherit success)))
`(epa-validity-low ((,c :inherit shadow)))
`(epa-validity-medium ((,c :foreground ,note)))
`(epa-validity-medium ((,c :foreground ,info)))
;;;;; erc
`(erc-action-face ((,c :foreground ,accent-2)))
`(erc-bold-face ((,c :inherit bold)))
@ -2093,7 +2057,7 @@ is a less intense variant of BG."
`(evil-ex-substitute-replacement ((,c :inherit modus-themes-search-current)))
;;;;; eww
`(eww-invalid-certificate ((,c :foreground ,err)))
`(eww-valid-certificate ((,c :foreground ,note)))
`(eww-valid-certificate ((,c :foreground ,info)))
`(eww-form-checkbox ((,c :inherit eww-form-text)))
`(eww-form-file ((,c :inherit eww-form-submit)))
`(eww-form-select ((,c :inherit eww-form-submit)))
@ -2101,7 +2065,7 @@ is a less intense variant of BG."
`(eww-form-text ((,c :inherit widget-field)))
`(eww-form-textarea ((,c :inherit eww-form-text)))
;;;;; eyebrowse
`(eyebrowse-mode-line-active ((,c :inherit bold :foreground ,note)))
`(eyebrowse-mode-line-active ((,c :inherit mode-line-emphasis)))
;;;;; flycheck
`(flycheck-error ((,c :inherit modus-themes-lang-error)))
`(flycheck-fringe-error ((,c :inherit modus-themes-intense-red)))
@ -2156,7 +2120,7 @@ is a less intense variant of BG."
`(geiser-font-lock-doc-button ((,c :inherit button)))
`(geiser-font-lock-doc-link ((,c :inherit button)))
`(geiser-font-lock-error-link ((,c :inherit button :foreground ,err)))
`(geiser-font-lock-image-button ((,c :inherit button :foreground ,note)))
`(geiser-font-lock-image-button ((,c :inherit button :foreground ,info)))
`(geiser-font-lock-repl-input ((,c :inherit bold)))
`(geiser-font-lock-repl-output ((,c :inherit font-lock-keyword-face)))
`(geiser-font-lock-repl-prompt ((,c :inherit modus-themes-prompt)))
@ -2171,17 +2135,17 @@ is a less intense variant of BG."
`(git-commit-keyword ((,c :foreground ,keyword)))
`(git-commit-nonempty-second-line ((,c :inherit error)))
`(git-commit-overlong-summary ((,c :inherit warning)))
`(git-commit-summary ((,c :inherit bold :foreground ,note)))
`(git-commit-summary ((,c :inherit bold :foreground ,info)))
;;;;; git-gutter
`(git-gutter:added ((,c :background ,@(modus-themes--deuteran bg-added-intense-deuteran bg-added-intense))))
`(git-gutter:deleted ((,c :inherit modus-themes-intense-red)))
`(git-gutter:modified ((,c :inherit modus-themes-intense-yellow)))
`(git-gutter:added ((,c :background ,bg-added-intense)))
`(git-gutter:deleted ((,c :background ,bg-removed-intense)))
`(git-gutter:modified ((,c :background ,bg-changed-intense)))
`(git-gutter:separator ((,c :inherit modus-themes-intense-cyan)))
`(git-gutter:unchanged ((,c :inherit modus-themes-intense-magenta)))
;;;;; git-gutter-fr
`(git-gutter-fr:added ((,c :background ,@(modus-themes--deuteran bg-added-intense-deuteran bg-added-intense))))
`(git-gutter-fr:deleted ((,c :inherit modus-themes-intense-red)))
`(git-gutter-fr:modified ((,c :inherit modus-themes-intense-yellow)))
`(git-gutter-fr:added ((,c :background ,bg-added-intense)))
`(git-gutter-fr:deleted ((,c :background ,bg-removed-intense)))
`(git-gutter-fr:modified ((,c :background ,bg-changed-intense)))
;;;;; git-rebase
`(git-rebase-comment-hash ((,c :inherit (bold font-lock-comment-face) :foreground ,identifier)))
`(git-rebase-comment-heading ((,c :inherit (bold font-lock-comment-face))))
@ -2461,7 +2425,7 @@ is a less intense variant of BG."
`(journalctl-finished-face ((,c :inherit success)))
`(journalctl-host-face ((,c :foreground ,name)))
`(journalctl-process-face ((,c :foreground ,warning)))
`(journalctl-starting-face ((,c :foreground ,note)))
`(journalctl-starting-face ((,c :foreground ,info)))
`(journalctl-timestamp-face ((,c :foreground ,date)))
`(journalctl-warning-face ((,c :inherit warning)))
;;;;; js2-mode
@ -2543,10 +2507,8 @@ is a less intense variant of BG."
`(magit-branch-warning ((,c :inherit warning)))
`(magit-cherry-equivalent ((,c :foreground ,magenta)))
`(magit-cherry-unmatched ((,c :foreground ,cyan)))
`(magit-diff-added ((,c :background ,@(modus-themes--deuteran bg-added-faint-deuteran bg-added-faint)
:foreground ,@(modus-themes--deuteran fg-added-deuteran fg-added))))
`(magit-diff-added-highlight ((,c :background ,@(modus-themes--deuteran bg-added-deuteran bg-added)
:foreground ,@(modus-themes--deuteran fg-added-deuteran fg-added))))
`(magit-diff-added ((,c :background ,bg-added-faint :foreground ,fg-added)))
`(magit-diff-added-highlight ((,c :background ,bg-added :foreground ,fg-added)))
`(magit-diff-base ((,c :background ,bg-changed-faint :foreground ,fg-changed)))
`(magit-diff-base-highlight ((,c :background ,bg-changed :foreground ,fg-changed)))
`(magit-diff-context ((,c :inherit shadow)))
@ -2729,7 +2691,7 @@ is a less intense variant of BG."
:foreground ,fg-mode-line-active)))
`(mode-line-active ((,c :inherit mode-line)))
`(mode-line-buffer-id ((,c :inherit bold)))
`(mode-line-emphasis ((,c :inherit bold :foreground ,note)))
`(mode-line-emphasis ((,c :inherit bold :foreground ,info)))
`(mode-line-highlight ((,c :background ,bg-hover :foreground ,fg-main :box ,fg-main)))
`(mode-line-inactive ((,c :inherit modus-themes-ui-variable-pitch
:box ,border-mode-line-inactive
@ -2738,9 +2700,9 @@ is a less intense variant of BG."
;;;;; mood-line
`(mood-line-modified ((,c :inherit italic)))
`(mood-line-status-error ((,c :inherit error)))
`(mood-line-status-info ((,c :inherit success)))
`(mood-line-status-info ((,c :foreground ,info)))
`(mood-line-status-neutral (( )))
`(mood-line-status-success ((,c :inherit modus-themes-grue)))
`(mood-line-status-success ((,c :inherit success)))
`(mood-line-status-warning ((,c :inherit warning)))
`(mood-line-unimportant ((,c :inherit shadow)))
;;;;; mpdel
@ -2762,7 +2724,7 @@ is a less intense variant of BG."
`(mu4e-draft-face ((,c :foreground ,warning)))
`(mu4e-flagged-face ((,c :foreground ,err)))
`(mu4e-footer-face ((,c :inherit italic :foreground ,fg-alt)))
`(mu4e-forwarded-face ((,c :inherit italic :foreground ,note)))
`(mu4e-forwarded-face ((,c :inherit italic :foreground ,info)))
`(mu4e-header-face ((,c :inherit shadow)))
`(mu4e-header-highlight-face ((,c :inherit highlight)))
`(mu4e-header-key-face ((,c :inherit message-header-name)))
@ -2776,7 +2738,7 @@ is a less intense variant of BG."
`(mu4e-ok-face ((,c :inherit success)))
`(mu4e-region-code ((,c :foreground ,builtin)))
`(mu4e-related-face ((,c :inherit (italic shadow))))
`(mu4e-replied-face ((,c :foreground ,note)))
`(mu4e-replied-face ((,c :foreground ,info)))
`(mu4e-special-header-value-face ((,c :inherit message-header-subject)))
`(mu4e-system-face ((,c :inherit italic)))
`(mu4e-title-face (( )))
@ -2825,7 +2787,7 @@ is a less intense variant of BG."
`(notmuch-search-non-matching-authors ((,c :inherit shadow)))
`(notmuch-search-subject ((,c :foreground ,fg-main)))
`(notmuch-search-unread-face ((,c :inherit bold)))
`(notmuch-tag-added ((,c :underline ,note)))
`(notmuch-tag-added ((,c :underline ,info)))
`(notmuch-tag-deleted ((,c :strike-through ,err)))
`(notmuch-tag-face ((,c :foreground ,accent-0)))
`(notmuch-tag-flagged ((,c :foreground ,err)))
@ -2909,7 +2871,7 @@ is a less intense variant of BG."
`(org-document-info ((,c :foreground ,fg-alt)))
`(org-document-info-keyword ((,c :inherit shadow)))
`(org-document-title ((,c :inherit modus-themes-heading-0)))
`(org-done ((,c :inherit modus-themes-grue)))
`(org-done ((,c :foreground ,info)))
`(org-drawer ((,c :inherit (shadow modus-themes-fixed-pitch))))
`(org-ellipsis (( ))) ; inherits from the heading's color
`(org-footnote ((,c :inherit link)))
@ -2961,8 +2923,8 @@ is a less intense variant of BG."
`(org-habit-clear-future-face ((,c :background ,blue-graph-1-bg)))
`(org-habit-overdue-face ((,c :background ,red-graph-0-bg)))
`(org-habit-overdue-future-face ((,c :background ,red-graph-1-bg)))
`(org-habit-ready-face ((,c :background ,@(modus-themes--deuteran green-graph-0-bg blue-graph-0-bg) :foreground "black"))) ; fg is special case
`(org-habit-ready-future-face ((,c :background ,@(modus-themes--deuteran green-graph-1-bg blue-graph-1-bg))))
`(org-habit-ready-face ((,c :background ,blue-graph-0-bg :foreground "black"))) ; fg is special case
`(org-habit-ready-future-face ((,c :background ,blue-graph-1-bg)))
;;;;; org-journal
`(org-journal-calendar-entry-face ((,c :inherit modus-themes-slant :foreground ,date)))
`(org-journal-calendar-scheduled-face ((,c :inherit (modus-themes-slant org-scheduled))))
@ -2972,7 +2934,7 @@ is a less intense variant of BG."
`(org-noter-notes-exist-face ((,c :inherit success)))
;;;;; org-pomodoro
`(org-pomodoro-mode-line ((,c :foreground ,err)))
`(org-pomodoro-mode-line-break ((,c :foreground ,note)))
`(org-pomodoro-mode-line-break ((,c :foreground ,info)))
`(org-pomodoro-mode-line-overtime ((,c :inherit error)))
;;;;; org-recur
`(org-recur ((,c :foreground ,fg-alt)))
@ -3079,7 +3041,7 @@ is a less intense variant of BG."
`(pulse-highlight-start-face ((,c :background ,bg-blue :extend t)))
;;;;; pyim
`(pyim-page ((,c :background ,bg-active)))
`(pyim-page-selection ((,c :inherit bold :background ,bg-active :foreground ,note)))
`(pyim-page-selection ((,c :inherit bold :background ,bg-active :foreground ,info)))
`(pyim-page-subword ((,c :background ,bg-inactive)))
;;;;; quick-peek
`(quick-peek-background-face ((,c :background ,bg-inactive)))
@ -3218,7 +3180,7 @@ is a less intense variant of BG."
`(sly-style-warning-face ((,c :inherit modus-themes-lang-note)))
`(sly-warning-face ((,c :inherit modus-themes-lang-warning)))
;;;;; smart-mode-line
`(sml/charging ((,c :foreground ,success)))
`(sml/charging ((,c :foreground ,info)))
`(sml/discharging ((,c :foreground ,err)))
`(sml/filename ((,c :inherit bold :foreground ,name)))
`(sml/folder (( )))
@ -3445,7 +3407,7 @@ is a less intense variant of BG."
`(vc-dir-mark-indicator (( )))
`(vc-dir-status-edited ((,c :inherit italic)))
`(vc-dir-status-ignored ((,c :inherit shadow)))
`(vc-dir-status-up-to-date ((,c :foreground ,note)))
`(vc-dir-status-up-to-date ((,c :foreground ,info)))
`(vc-dir-status-warning ((,c :inherit error)))
`(vc-conflict-state ((,c :inherit error)))
`(vc-edited-state ((,c :inherit italic)))

View file

@ -0,0 +1,253 @@
;;; modus-vivendi-deuteranopia-theme.el --- Elegant, highly legible and customizable dark theme -*- lexical-binding:t -*-
;; Copyright (C) 2019-2022 Free Software Foundation, Inc.
;; Author: Protesilaos Stavrou <info@protesilaos.com>
;; Maintainer: Modus-Themes Development <~protesilaos/modus-themes@lists.sr.ht>
;; URL: https://git.sr.ht/~protesilaos/modus-themes
;; Mailing-List: https://lists.sr.ht/~protesilaos/modus-themes
;; 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))
(deftheme modus-vivendi-deuteranopia
"Elegant, highly legible and customizable dark theme.
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).")
(defconst modus-vivendi-deuteranopia-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 "#ff6b55")
(red-cooler "#ff7f9f")
(red-faint "#ff9580")
(red-intense "#ff5f5f")
(green "#44bc44")
(green-warmer "#70b900")
(green-cooler "#00c06f")
(green-faint "#88ca9f")
(green-intense "#44df44")
(yellow "#d0bc00")
(yellow-warmer "#fec43f")
(yellow-cooler "#dfaf7a")
(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 "#cab2df")
(magenta-intense "#ff66ff")
(cyan "#00d3d0")
(cyan-warmer "#4ae2f0")
(cyan-cooler "#6ae4b9")
(cyan-faint "#9ac8e0")
(cyan-intense "#00eff0")
;;; Common accent backgrounds
(bg-red "#9d1f1f")
(bg-green "#2f822f")
(bg-yellow "#7a6100")
(bg-blue "#1640b0")
(bg-magenta "#7030af")
(bg-cyan "#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")
;;; Graphs
(red-graph-0-bg "#b52c2c")
(red-graph-1-bg "#702020")
(green-graph-0-bg "#4fd100")
(green-graph-1-bg "#007800")
(yellow-graph-0-bg "#f1e00a")
(yellow-graph-1-bg "#b08600")
(blue-graph-0-bg "#2fafef")
(blue-graph-1-bg "#1f2f8f")
(magenta-graph-0-bg "#bf94fe")
(magenta-graph-1-bg "#5f509f")
(cyan-graph-0-bg "#47dfea")
(cyan-graph-1-bg "#00808f")
;;; Special purpose
(bg-completion "#2f447f")
(bg-hover "#004f70")
(bg-hover-secondary "#654a39")
(bg-hl-line "#2f3849")
(bg-paren-match "#2f7f9f")
(bg-paren-expression "#453040")
(bg-region "#5c5c5c")
(bg-region-subtle "#4f1c2f")
(bg-prompt "#5f3f20")
(bg-char-0 "#0050af")
(bg-char-1 "#7f1f7f")
(bg-char-2 "#625a00")
;;; Diffs
(bg-added "#003366")
(bg-added-faint "#001f4f")
(bg-added-refine "#0f4f7f")
(bg-added-intense "#0f4fbf")
(fg-added "#c4d5ff")
(bg-changed "#2f123f")
(bg-changed-faint "#1f022f")
(bg-changed-refine "#3f325f")
(bg-changed-intense "#7f42af")
(fg-changed "#e3cfff")
(bg-removed "#3f3f00")
(bg-removed-faint "#281f00")
(bg-removed-refine "#535300")
(bg-removed-intense "#dfd23a")
(fg-removed "#d4d48f")
;;;; Mappings
(bg-mode-line-active bg-active)
(fg-mode-line-active fg-main)
(border-mode-line-active fg-dim)
(bg-mode-line-inactive bg-inactive)
(fg-mode-line-inactive fg-dim)
(border-mode-line-inactive border)
(cursor fg-main)
(builtin magenta-warmer)
(comment fg-dim)
(constant blue-cooler)
(docstring cyan-faint)
(fnname magenta)
(keyword magenta-cooler)
(preprocessor red-cooler)
(string blue-warmer)
(type cyan-cooler)
(variable cyan)
(date cyan)
(weekend blue) ; for M-x calendar and Org agenda
(keybind blue-cooler)
(link blue-warmer)
(link-symbolic cyan)
(link-visited yellow-faint)
(name blue-cooler)
(identifier yellow-faint)
(tag magenta-faint)
(prompt cyan-cooler)
(rx-construct yellow-cooler)
(rx-backslash blue-cooler)
(err yellow-warmer)
(warning yellow-cooler)
(info blue)
(underline-err red-intense)
(underline-warning yellow-intense)
(underline-note cyan-intense)
(accent-0 blue-cooler)
(accent-1 yellow)
(accent-2 cyan-cooler)
(accent-3 magenta-warmer)
(bg-accent-0 bg-blue-subtle)
(bg-accent-1 bg-yellow-subtle)
(bg-accent-2 bg-cyan-subtle)
(bg-accent-3 bg-magenta-subtle)
(mail-cite-0 blue-warmer)
(mail-cite-1 yellow-cooler)
(mail-cite-2 blue-cooler)
(mail-cite-3 yellow)
(mail-part blue)
(mail-recipient blue)
(mail-subject yellow-warmer)
(mail-other cyan-faint)
(heading-0 cyan-cooler)
(heading-1 fg-main)
(heading-2 yellow-faint)
(heading-3 blue-faint)
(heading-4 magenta)
(heading-5 green-faint)
(heading-6 red-faint)
(heading-7 cyan-faint)
(heading-8 fg-dim)
(prose-code cyan-cooler)
(prose-macro magenta-cooler)
(prose-verbatim magenta-warmer))
"The entire palette of the `modus-vivendi-deuteranopia' theme.
Each element has the form (NAME HEX) with the former as a
symbol and the latter as a string.")
(defvar modus-vivendi-deuteranopia-palette-overrides nil
"Overrides for `modus-vivendi-deuteranopia-palette'.")
(modus-themes-theme modus-vivendi-deuteranopia modus-vivendi-deuteranopia-palette modus-vivendi-deuteranopia-palette-overrides)
(provide-theme 'modus-vivendi-deuteranopia))
;;;###theme-autoload
(put 'modus-vivendi-deuteranopia 'theme-properties '(:background-mode dark :kind color-scheme :family modus))
;;; modus-vivendi-deuteranopia-theme.el ends here

View file

@ -144,17 +144,11 @@ which corresponds to a minimum contrast in relative luminance of
;;; Diffs
(bg-added "#00381f")
(bg-added-faint "#002910")
(bg-added-refine "#034f2f")
(bg-added-intense "#237f3f")
(fg-added "#a0e0a0")
(bg-added-deuteran "#00234f")
(bg-added-faint-deuteran "#00143f")
(bg-added-refine-deuteran "#03395f")
(bg-added-intense-deuteran "#03699f")
(fg-added-deuteran "#bbccff")
(bg-added "#00381f")
(bg-added-faint "#002910")
(bg-added-refine "#034f2f")
(bg-added-intense "#237f3f")
(fg-added "#a0e0a0")
(bg-changed "#363300")
(bg-changed-faint "#2a1f00")
@ -205,8 +199,7 @@ which corresponds to a minimum contrast in relative luminance of
(err red)
(warning yellow-warmer)
(success green)
(note cyan)
(info green)
(underline-err red-intense)
(underline-warning yellow-intense)

View file

@ -144,17 +144,11 @@ which corresponds to a minimum contrast in relative luminance of
;;; Diffs
(bg-added "#003826")
(bg-added-faint "#002915")
(bg-added-refine "#034f36")
(bg-added-intense "#237f3f")
(fg-added "#a0e0a0")
(bg-added-deuteran "#00234f")
(bg-added-faint-deuteran "#00143f")
(bg-added-refine-deuteran "#03395f")
(bg-added-intense-deuteran "#03699f")
(fg-added-deuteran "#bbccff")
(bg-added "#003826")
(bg-added-faint "#002915")
(bg-added-refine "#034f36")
(bg-added-intense "#237f3f")
(fg-added "#a0e0a0")
(bg-changed "#363300")
(bg-changed-faint "#2a1f00")
@ -205,8 +199,7 @@ which corresponds to a minimum contrast in relative luminance of
(err red)
(warning yellow-warmer)
(success green)
(note cyan)
(info green)
(underline-err red-intense)
(underline-warning yellow-intense)