Archived
1
0
Fork 0
This repository has been archived on 2024-10-19. You can view files and clone it, but cannot push or open issues or pull requests.
emacs/org/elpa/modus-themes-20240728.1007/modus-operandi-tritanopia-theme.el

542 lines
16 KiB
EmacsLisp
Raw Permalink Normal View History

2023-08-10 14:03:04 +00:00
;;; modus-operandi-tritanopia-theme.el --- Tritanopia-optimized theme with a white background -*- lexical-binding:t -*-
2023-02-21 18:17:08 +00:00
2024-07-28 16:03:37 +00:00
;; Copyright (C) 2019-2024 Free Software Foundation, Inc.
2023-02-21 18:17:08 +00:00
;; Author: Protesilaos Stavrou <info@protesilaos.com>
2024-07-28 16:03:37 +00:00
;; Maintainer: Protesilaos Stavrou <info@protesilaos.com>
;; URL: https://github.com/protesilaos/modus-themes
2023-02-21 18:17:08 +00:00
;; 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))
2023-08-30 13:03:41 +00:00
;;;###theme-autoload
2023-08-10 14:03:04 +00:00
(deftheme modus-operandi-tritanopia
"Tritanopia-optimized theme with a white background.
This variant is optimized for users with blue-yellow color
deficiency (tritanopia). It 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
2023-08-30 13:03:41 +00:00
standard)."
:background-mode 'light
:kind 'color-scheme
:family 'modus)
2023-02-21 18:17:08 +00:00
2023-08-10 14:03:04 +00:00
(defconst modus-operandi-tritanopia-palette
2023-02-21 18:17:08 +00:00
'(
;;; Basic values
(bg-main "#ffffff")
2023-08-10 14:03:04 +00:00
(bg-dim "#f2f2f2")
2023-02-21 18:17:08 +00:00
(fg-main "#000000")
(fg-dim "#595959")
(fg-alt "#193668")
(bg-active "#c4c4c4")
(bg-inactive "#e0e0e0")
(border "#9f9f9f")
;;; Common accent foregrounds
(red "#a60000")
2023-08-10 14:03:04 +00:00
(red-warmer "#b21100")
2023-02-21 18:17:08 +00:00
(red-cooler "#a0132f")
2023-08-10 14:03:04 +00:00
(red-faint "#702000")
2023-02-21 18:17:08 +00:00
(red-intense "#d00000")
(green "#006800")
(green-warmer "#316500")
(green-cooler "#00663f")
(green-faint "#2a5045")
(green-intense "#008900")
2023-08-10 14:03:04 +00:00
(yellow "#695500")
(yellow-warmer "#973300")
(yellow-cooler "#77492f")
2023-02-21 18:17:08 +00:00
(yellow-faint "#624416")
(yellow-intense "#808000")
(blue "#0031a9")
(blue-warmer "#3548cf")
(blue-cooler "#0000b0")
(blue-faint "#003497")
(blue-intense "#0000ff")
(magenta "#721045")
(magenta-warmer "#8f0075")
(magenta-cooler "#531ab6")
(magenta-faint "#7c318f")
2023-08-10 14:03:04 +00:00
(magenta-intense "#cd22bd")
2023-02-21 18:17:08 +00:00
(cyan "#005e8b")
(cyan-warmer "#3f578f")
(cyan-cooler "#005f5f")
2023-08-10 14:03:04 +00:00
(cyan-faint "#004f5f")
2023-02-21 18:17:08 +00:00
(cyan-intense "#008899")
;;; Uncommon accent foregrounds
(rust "#8a290f")
(gold "#80601f")
(olive "#56692d")
(slate "#2f3f83")
(indigo "#4a3a8a")
(maroon "#731c52")
(pink "#7b435c")
;;; Common accent backgrounds
(bg-red-intense "#ff8f88")
(bg-green-intense "#8adf80")
(bg-yellow-intense "#f3d000")
(bg-blue-intense "#bfc9ff")
(bg-magenta-intense "#dfa0f0")
(bg-cyan-intense "#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")
2024-07-28 16:03:37 +00:00
(bg-red-nuanced "#ffe8e8")
(bg-green-nuanced "#e0f6e0")
(bg-yellow-nuanced "#f8f0d0")
(bg-blue-nuanced "#ecedff")
(bg-magenta-nuanced "#f8e6f5")
(bg-cyan-nuanced "#e0f2fa")
2023-02-21 18:17:08 +00:00
2024-07-28 16:03:37 +00:00
;;; Uncommon accent background and foreground pairs
(bg-clay "#f1c8b5")
(fg-clay "#63192a")
(bg-ochre "#f0e3c0")
(fg-ochre "#573a30")
(bg-lavender "#dfcdfa")
(fg-lavender "#443379")
2023-02-21 18:17:08 +00:00
(bg-sage "#c0e7d4")
2024-07-28 16:03:37 +00:00
(fg-sage "#124b41")
2023-02-21 18:17:08 +00:00
;;; Graphs
(bg-graph-red-0 "#ef7969")
(bg-graph-red-1 "#ffaab4")
2024-07-28 16:03:37 +00:00
(bg-graph-green-0 "#68c0a0")
(bg-graph-green-1 "#a5dfd0")
2023-08-10 14:03:04 +00:00
(bg-graph-yellow-0 "#d99f9f")
(bg-graph-yellow-1 "#ffb58f")
(bg-graph-blue-0 "#80a0df")
2024-07-28 16:03:37 +00:00
(bg-graph-blue-1 "#a8cfff")
2023-08-10 14:03:04 +00:00
(bg-graph-magenta-0 "#efafcf")
(bg-graph-magenta-1 "#ffdaef")
(bg-graph-cyan-0 "#7fd3ed")
2023-02-21 18:17:08 +00:00
(bg-graph-cyan-1 "#afefff")
;;; Special purpose
2023-08-10 14:03:04 +00:00
(bg-completion "#afdfef")
(bg-hover "#ffafbc")
(bg-hover-secondary "#9fdfff")
(bg-hl-line "#dfeaec")
2023-02-21 18:17:08 +00:00
(bg-region "#bdbdbd")
(fg-region "#000000")
2023-08-10 14:03:04 +00:00
(bg-char-0 "#ff908f")
(bg-char-1 "#bfbfff")
(bg-char-2 "#5fcfdf")
2023-02-21 18:17:08 +00:00
2023-08-10 14:03:04 +00:00
(bg-mode-line-active "#afe0f2")
(fg-mode-line-active "#0f0f0f")
(border-mode-line-active "#2f4f44")
2023-02-21 18:17:08 +00:00
(bg-mode-line-inactive "#e6e6e6")
(fg-mode-line-inactive "#585858")
(border-mode-line-inactive "#a3a3a3")
2023-08-10 14:03:04 +00:00
(modeline-err "#8f0000")
(modeline-warning "#6f306f")
(modeline-info "#00445f")
2023-02-21 18:17:08 +00:00
(bg-tab-bar "#dfdfdf")
(bg-tab-current "#ffffff")
(bg-tab-other "#c2c2c2")
;;; Diffs
2023-08-10 14:03:04 +00:00
(bg-added "#b5e7ff")
(bg-added-faint "#c6f6ff")
(bg-added-refine "#9adcef")
(bg-added-fringe "#1782cc")
(fg-added "#005079")
(fg-added-intense "#0043aa")
2023-02-21 18:17:08 +00:00
2023-08-10 14:03:04 +00:00
(bg-changed "#eecfdf")
(bg-changed-faint "#f0dde5")
(bg-changed-refine "#e0b0d0")
(bg-changed-fringe "#9f6ab0")
(fg-changed "#6f1343")
(fg-changed-intense "#7f0f9f")
2023-02-21 18:17:08 +00:00
(bg-removed "#ffd8d5")
(bg-removed-faint "#ffe9e9")
(bg-removed-refine "#f3b5af")
(bg-removed-fringe "#d84a4f")
(fg-removed "#8f1313")
(fg-removed-intense "#aa2222")
(bg-diff-context "#f3f3f3")
;;; Paren match
(bg-paren-match "#5fcfff")
2024-07-28 16:03:37 +00:00
(fg-paren-match fg-main)
2023-02-21 18:17:08 +00:00
(bg-paren-expression "#efd3f5")
(underline-paren-match unspecified)
;;; Mappings
;;;; General mappings
(fringe bg-dim)
2023-08-10 14:03:04 +00:00
(cursor red-intense)
2023-02-21 18:17:08 +00:00
2023-08-10 14:03:04 +00:00
(keybind red)
(name red-cooler)
(identifier red-faint)
2023-02-21 18:17:08 +00:00
2023-08-10 14:03:04 +00:00
(err red-warmer)
(warning magenta)
(info cyan)
2023-02-21 18:17:08 +00:00
(underline-err red-intense)
2023-08-10 14:03:04 +00:00
(underline-warning magenta-intense)
2023-02-21 18:17:08 +00:00
(underline-note cyan-intense)
2023-08-10 14:03:04 +00:00
(bg-prominent-err bg-red-intense)
(fg-prominent-err fg-main)
(bg-prominent-warning bg-magenta-intense)
(fg-prominent-warning fg-main)
(bg-prominent-note bg-cyan-intense)
(fg-prominent-note fg-main)
2024-07-28 16:03:37 +00:00
(bg-active-argument bg-red-nuanced)
(fg-active-argument red-warmer)
(bg-active-value bg-cyan-nuanced)
(fg-active-value cyan)
2023-02-21 18:17:08 +00:00
;;;; Code mappings
2024-07-28 16:03:37 +00:00
(bracket fg-main)
2023-08-10 14:03:04 +00:00
(builtin magenta)
(comment red-faint)
(constant green-cooler)
2024-07-28 16:03:37 +00:00
(delimiter fg-main)
2023-02-21 18:17:08 +00:00
(docmarkup magenta-faint)
2024-07-28 16:03:37 +00:00
(docstring fg-alt)
2023-08-10 14:03:04 +00:00
(fnname cyan-warmer)
(keyword red-cooler)
2024-07-28 16:03:37 +00:00
(number fg-main)
(operator fg-main)
2023-08-10 14:03:04 +00:00
(preprocessor red-warmer)
2024-07-28 16:03:37 +00:00
(punctuation fg-main)
(rx-backslash magenta)
(rx-construct red)
2023-08-10 14:03:04 +00:00
(string cyan)
(type blue-warmer)
(variable cyan-cooler)
2023-02-21 18:17:08 +00:00
;;;; Accent mappings
2023-08-10 14:03:04 +00:00
(accent-0 cyan)
(accent-1 red-warmer)
(accent-2 cyan-cooler)
(accent-3 magenta)
2023-02-21 18:17:08 +00:00
;;;; Button mappings
(fg-button-active fg-main)
(fg-button-inactive fg-dim)
(bg-button-active bg-active)
(bg-button-inactive bg-dim)
;;;; Completion mappings
2023-08-10 14:03:04 +00:00
(fg-completion-match-0 cyan)
(fg-completion-match-1 red-warmer)
(fg-completion-match-2 magenta)
(fg-completion-match-3 cyan-cooler)
2023-02-21 18:17:08 +00:00
(bg-completion-match-0 unspecified)
(bg-completion-match-1 unspecified)
(bg-completion-match-2 unspecified)
(bg-completion-match-3 unspecified)
;;;; Date mappings
2023-08-10 14:03:04 +00:00
(date-common cyan-cooler)
2023-02-21 18:17:08 +00:00
(date-deadline red)
(date-event fg-alt)
2023-08-10 14:03:04 +00:00
(date-holiday red)
(date-holiday-other cyan)
2023-02-21 18:17:08 +00:00
(date-now fg-main)
2023-08-10 14:03:04 +00:00
(date-range fg-alt)
(date-scheduled magenta)
2023-02-21 18:17:08 +00:00
(date-weekday cyan)
(date-weekend red-faint)
;;;; Line number mappings
(fg-line-number-inactive fg-dim)
(fg-line-number-active fg-main)
(bg-line-number-inactive bg-dim)
(bg-line-number-active bg-active)
;;;; Link mappings
2023-08-10 14:03:04 +00:00
(fg-link cyan)
2023-02-21 18:17:08 +00:00
(bg-link unspecified)
2023-08-10 14:03:04 +00:00
(underline-link cyan)
2023-02-21 18:17:08 +00:00
2023-08-10 14:03:04 +00:00
(fg-link-symbolic cyan-cooler)
2023-02-21 18:17:08 +00:00
(bg-link-symbolic unspecified)
2023-08-10 14:03:04 +00:00
(underline-link-symbolic cyan-cooler)
2023-02-21 18:17:08 +00:00
(fg-link-visited magenta)
(bg-link-visited unspecified)
(underline-link-visited magenta)
;;;; Mail mappings
2023-08-10 14:03:04 +00:00
(mail-cite-0 cyan-faint)
(mail-cite-1 red-faint)
(mail-cite-2 magenta-warmer)
(mail-cite-3 cyan-warmer)
(mail-part cyan-cooler)
(mail-recipient cyan)
(mail-subject red-cooler)
(mail-other cyan)
;;;; Mark mappings
(bg-mark-delete bg-red-subtle)
(fg-mark-delete red)
(bg-mark-select bg-cyan-subtle)
(fg-mark-select cyan)
(bg-mark-other bg-magenta-subtle)
(fg-mark-other magenta)
2023-02-21 18:17:08 +00:00
;;;; Prompt mappings
(fg-prompt cyan-cooler)
(bg-prompt unspecified)
;;;; Prose mappings
2024-07-28 16:03:37 +00:00
(bg-prose-block-delimiter bg-dim)
(fg-prose-block-delimiter fg-dim)
(bg-prose-block-contents bg-dim)
(bg-prose-code unspecified)
(fg-prose-code cyan)
(bg-prose-macro unspecified)
(fg-prose-macro red-warmer)
(bg-prose-verbatim unspecified)
(fg-prose-verbatim magenta-warmer)
2023-08-10 14:03:04 +00:00
(prose-done cyan)
2024-07-28 16:03:37 +00:00
(prose-todo red)
2023-02-21 18:17:08 +00:00
(prose-metadata fg-dim)
(prose-metadata-value fg-alt)
2024-07-28 16:03:37 +00:00
2023-02-21 18:17:08 +00:00
(prose-table fg-alt)
2024-07-28 16:03:37 +00:00
(prose-table-formula red-cooler)
(prose-tag magenta-faint)
2023-02-21 18:17:08 +00:00
;;;; Rainbow mappings
2023-08-10 14:03:04 +00:00
(rainbow-0 cyan)
(rainbow-1 red)
(rainbow-2 cyan-warmer)
(rainbow-3 red-cooler)
(rainbow-4 cyan-cooler)
(rainbow-5 magenta)
(rainbow-6 cyan-faint)
(rainbow-7 magenta-faint)
(rainbow-8 red-faint)
2024-07-28 16:03:37 +00:00
;;;; Search mappings
(bg-search-current bg-red-intense)
(bg-search-lazy bg-cyan-intense)
(bg-search-replace bg-magenta-intense)
(bg-search-rx-group-0 bg-blue-intense)
(bg-search-rx-group-1 bg-magenta-intense)
(bg-search-rx-group-2 bg-cyan-subtle)
(bg-search-rx-group-3 bg-red-subtle)
2023-08-10 14:03:04 +00:00
;;;; Space mappings
(bg-space unspecified)
(fg-space border)
(bg-space-err bg-red-intense)
;;;; Terminal mappings
2024-07-28 16:03:37 +00:00
(bg-term-black "#000000")
(fg-term-black "#000000")
(bg-term-black-bright "#595959")
(fg-term-black-bright "#595959")
2023-08-10 14:03:04 +00:00
(bg-term-red red)
(fg-term-red red)
(bg-term-red-bright red-warmer)
(fg-term-red-bright red-warmer)
(bg-term-green green)
(fg-term-green green)
(bg-term-green-bright green-cooler)
(fg-term-green-bright green-cooler)
(bg-term-yellow yellow)
(fg-term-yellow yellow)
(bg-term-yellow-bright yellow-warmer)
(fg-term-yellow-bright yellow-warmer)
(bg-term-blue blue)
(fg-term-blue blue)
(bg-term-blue-bright blue-warmer)
(fg-term-blue-bright blue-warmer)
(bg-term-magenta magenta)
(fg-term-magenta magenta)
(bg-term-magenta-bright magenta-cooler)
(fg-term-magenta-bright magenta-cooler)
(bg-term-cyan cyan)
(fg-term-cyan cyan)
(bg-term-cyan-bright cyan-cooler)
(fg-term-cyan-bright cyan-cooler)
2024-07-28 16:03:37 +00:00
(bg-term-white "#a6a6a6")
(fg-term-white "#a6a6a6")
(bg-term-white-bright "#ffffff")
(fg-term-white-bright "#ffffff")
2023-02-21 18:17:08 +00:00
;;;; Heading mappings
(fg-heading-0 cyan-cooler)
(fg-heading-1 fg-main)
2023-08-10 14:03:04 +00:00
(fg-heading-2 red-faint)
(fg-heading-3 cyan-faint)
2023-02-21 18:17:08 +00:00
(fg-heading-4 magenta)
(fg-heading-5 green-faint)
2023-08-10 14:03:04 +00:00
(fg-heading-6 magenta-faint)
2023-02-21 18:17:08 +00:00
(fg-heading-7 cyan-warmer)
(fg-heading-8 fg-dim)
(bg-heading-0 unspecified)
(bg-heading-1 unspecified)
(bg-heading-2 unspecified)
(bg-heading-3 unspecified)
(bg-heading-4 unspecified)
(bg-heading-5 unspecified)
(bg-heading-6 unspecified)
(bg-heading-7 unspecified)
(bg-heading-8 unspecified)
(overline-heading-0 unspecified)
(overline-heading-1 unspecified)
(overline-heading-2 unspecified)
(overline-heading-3 unspecified)
(overline-heading-4 unspecified)
(overline-heading-5 unspecified)
(overline-heading-6 unspecified)
(overline-heading-7 unspecified)
(overline-heading-8 unspecified))
2023-08-10 14:03:04 +00:00
"The entire palette of the `modus-operandi-tritanopia' theme.
2023-02-21 18:17:08 +00:00
Named colors have the form (COLOR-NAME HEX-VALUE) with the former
as a symbol and the latter as a string.
Semantic color mappings have the form (MAPPING-NAME COLOR-NAME)
with both as symbols. The latter is a named color that already
exists in the palette and is associated with a HEX-VALUE.")
2024-07-28 16:03:37 +00:00
(defcustom modus-operandi-tritanopia-palette-user nil
"Like the `modus-operandi-tritanopia-palette' for user-defined entries.
This is meant to extend the palette with custom named colors and/or
semantic palette mappings. Those may then be used in combination with
palette overrides (also see `modus-themes-common-palette-overrides' and
`modus-operandi-tritanopia-palette-overrides')."
:group 'modus-themes
:package-version '(modus-themes . "4.5.0")
:type '(repeat (list symbol (choice symbol string)))
:set #'modus-themes--set-option
:initialize #'custom-initialize-default
:link '(info-link "(modus-themes) Option to extend the palette for use with overrides"))
2023-08-10 14:03:04 +00:00
(defcustom modus-operandi-tritanopia-palette-overrides nil
"Overrides for `modus-operandi-tritanopia-palette'.
2023-02-21 18:17:08 +00:00
Mirror the elements of the aforementioned palette, overriding
their value.
For overrides that are shared across all of the Modus themes,
refer to `modus-themes-common-palette-overrides'.
Theme-specific overrides take precedence over shared overrides.
The idea of common overrides is to change semantic color
mappings, such as to make the cursor red. Wherea theme-specific
overrides can also be used to change the value of a named color,
such as what hexadecimal RGB value the red-warmer symbol
represents."
:group 'modus-themes
:package-version '(modus-themes . "4.0.0")
:version "30.1"
:type '(repeat (list symbol (choice symbol string)))
:set #'modus-themes--set-option
:initialize #'custom-initialize-default
:link '(info-link "(modus-themes) Palette overrides"))
2023-08-10 14:03:04 +00:00
(modus-themes-theme modus-operandi-tritanopia
modus-operandi-tritanopia-palette
modus-operandi-tritanopia-palette-overrides)
2023-02-21 18:17:08 +00:00
2023-08-10 14:03:04 +00:00
(provide-theme 'modus-operandi-tritanopia))
2023-02-21 18:17:08 +00:00
2023-08-10 14:03:04 +00:00
;;; modus-operandi-tritanopia-theme.el ends here