dotemacs

My Emacs configuration
git clone git://git.entf.net/dotemacs
Log | Files | Refs | LICENSE

modus-operandi-tinted-theme.el (14305B)


      1 ;;; modus-operandi-tinted-theme.el --- Elegant, highly legible theme with a light ochre 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 
     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-tinted
     47     "Elegant, highly legible theme with a light ochre background.
     48 Conforms with the highest legibility standard for color contrast
     49 between background and foreground in any given piece of text,
     50 which corresponds to a minimum contrast in relative luminance of
     51 7:1 (WCAG AAA standard)."
     52     :background-mode 'light
     53     :kind 'color-scheme
     54     :family 'modus)
     55 
     56   (defconst modus-operandi-tinted-palette
     57     '(
     58 ;;; Basic values
     59 
     60       (bg-main          "#fbf7f0")
     61       (bg-dim           "#efe9dd")
     62       (fg-main          "#000000")
     63       (fg-dim           "#595959")
     64       (fg-alt           "#193668")
     65       (bg-active        "#c9b9b0")
     66       (bg-inactive      "#dfd5cf")
     67       (border           "#9f9690")
     68 
     69 ;;; Common accent foregrounds
     70 
     71       (red             "#a60000")
     72       (red-warmer      "#972500")
     73       (red-cooler      "#a0132f")
     74       (red-faint       "#7f0000")
     75       (red-intense     "#d00000")
     76       (green           "#006800")
     77       (green-warmer    "#316500")
     78       (green-cooler    "#00663f")
     79       (green-faint     "#2a5045")
     80       (green-intense   "#008900")
     81       (yellow          "#6f5500")
     82       (yellow-warmer   "#884900")
     83       (yellow-cooler   "#7a4f2f")
     84       (yellow-faint    "#624416")
     85       (yellow-intense  "#808000")
     86       (blue            "#0031a9")
     87       (blue-warmer     "#3548cf")
     88       (blue-cooler     "#0000b0")
     89       (blue-faint      "#003497")
     90       (blue-intense    "#0000ff")
     91       (magenta         "#721045")
     92       (magenta-warmer  "#8f0075")
     93       (magenta-cooler  "#531ab6")
     94       (magenta-faint   "#7c318f")
     95       (magenta-intense "#dd22dd")
     96       (cyan            "#005e8b")
     97       (cyan-warmer     "#3f578f")
     98       (cyan-cooler     "#005f5f")
     99       (cyan-faint      "#005077")
    100       (cyan-intense    "#008899")
    101 
    102 ;;; Uncommon accent foregrounds
    103 
    104       (rust       "#8a290f")
    105       (gold       "#80601f")
    106       (olive      "#56692d")
    107       (slate      "#2f3f83")
    108       (indigo     "#4a3a8a")
    109       (maroon     "#731c52")
    110       (pink       "#7b435c")
    111 
    112 ;;; Common accent backgrounds
    113 
    114       (bg-red-intense     "#ff8f88")
    115       (bg-green-intense   "#8adf80")
    116       (bg-yellow-intense  "#f3d000")
    117       (bg-blue-intense    "#bfc9ff")
    118       (bg-magenta-intense "#dfa0f0")
    119       (bg-cyan-intense    "#a4d5f9")
    120 
    121       (bg-red-subtle      "#ffcfbf")
    122       (bg-green-subtle    "#b3fabf")
    123       (bg-yellow-subtle   "#fff576")
    124       (bg-blue-subtle     "#ccdfff")
    125       (bg-magenta-subtle  "#ffddff")
    126       (bg-cyan-subtle     "#bfefff")
    127 
    128       (bg-red-nuanced     "#ffe8f0")
    129       (bg-green-nuanced   "#e0f5e0")
    130       (bg-yellow-nuanced  "#f9ead0")
    131       (bg-blue-nuanced    "#ebebff")
    132       (bg-magenta-nuanced "#f6e7ff")
    133       (bg-cyan-nuanced    "#e1f3fc")
    134 
    135 ;;; Uncommon accent backgrounds
    136 
    137       (bg-ochre    "#f0e0cc")
    138       (bg-lavender "#dfdbfa")
    139       (bg-sage     "#c0e7d4")
    140 
    141 ;;; Graphs
    142 
    143       (bg-graph-red-0     "#ef7969")
    144       (bg-graph-red-1     "#ffaab4")
    145       (bg-graph-green-0   "#2fe029")
    146       (bg-graph-green-1   "#75ef30")
    147       (bg-graph-yellow-0  "#ffcf00")
    148       (bg-graph-yellow-1  "#f9ff00")
    149       (bg-graph-blue-0    "#7f90ff")
    150       (bg-graph-blue-1    "#9fc6ff")
    151       (bg-graph-magenta-0 "#e07fff")
    152       (bg-graph-magenta-1 "#fad0ff")
    153       (bg-graph-cyan-0    "#70d3f0")
    154       (bg-graph-cyan-1    "#afefff")
    155 
    156 ;;; Special purpose
    157 
    158       (bg-completion       "#f0c1cf")
    159       (bg-hover            "#b2e4dc")
    160       (bg-hover-secondary  "#f5d0a0")
    161       (bg-hl-line          "#f1d5d0")
    162       (bg-region           "#c2bcb5")
    163       (fg-region           "#000000")
    164 
    165       (bg-char-0 "#7feaff")
    166       (bg-char-1 "#ffaaff")
    167       (bg-char-2 "#dff000")
    168 
    169       (bg-mode-line-active        "#cab9b2")
    170       (fg-mode-line-active        "#000000")
    171       (border-mode-line-active    "#545454")
    172       (bg-mode-line-inactive      "#dfd9cf")
    173       (fg-mode-line-inactive      "#585858")
    174       (border-mode-line-inactive  "#a59a94")
    175 
    176       (modeline-err     "#7f0000")
    177       (modeline-warning "#5f0070")
    178       (modeline-info    "#002580")
    179 
    180       (bg-tab-bar      "#e0d4ce")
    181       (bg-tab-current  "#fbf7f0")
    182       (bg-tab-other    "#c8b8b2")
    183 
    184 ;;; Diffs
    185 
    186       (bg-added           "#c3ebc1")
    187       (bg-added-faint     "#dcf8d1")
    188       (bg-added-refine    "#acd6a5")
    189       (bg-added-fringe    "#6cc06c")
    190       (fg-added           "#005000")
    191       (fg-added-intense   "#006700")
    192 
    193       (bg-changed         "#ffdfa9")
    194       (bg-changed-faint   "#ffefbf")
    195       (bg-changed-refine  "#fac090")
    196       (bg-changed-fringe  "#c0b200")
    197       (fg-changed         "#553d00")
    198       (fg-changed-intense "#655000")
    199 
    200       (bg-removed         "#f4d0cf")
    201       (bg-removed-faint   "#ffe9e5")
    202       (bg-removed-refine  "#f3b5a7")
    203       (bg-removed-fringe  "#d84a4f")
    204       (fg-removed         "#8f1313")
    205       (fg-removed-intense "#aa2222")
    206 
    207       (bg-diff-context    "#efe9df")
    208 
    209 ;;; Paren match
    210 
    211       (bg-paren-match        "#7fdfcf")
    212       (bg-paren-expression   "#efd3f5")
    213       (underline-paren-match unspecified)
    214 
    215 ;;; Mappings
    216 
    217 ;;;; General mappings
    218 
    219       (fringe bg-dim)
    220       (cursor red)
    221 
    222       (keybind blue-cooler)
    223       (name magenta)
    224       (identifier yellow-cooler)
    225 
    226       (err red)
    227       (warning yellow-warmer)
    228       (info cyan-cooler)
    229 
    230       (underline-err red-intense)
    231       (underline-warning yellow-intense)
    232       (underline-note cyan-intense)
    233 
    234       (bg-prominent-err bg-red-intense)
    235       (fg-prominent-err fg-main)
    236       (bg-prominent-warning bg-yellow-intense)
    237       (fg-prominent-warning fg-main)
    238       (bg-prominent-note bg-cyan-intense)
    239       (fg-prominent-note fg-main)
    240 
    241 ;;;; Code mappings
    242 
    243       (builtin magenta-warmer)
    244       (comment red-faint)
    245       (constant blue-cooler)
    246       (docstring green-faint)
    247       (docmarkup magenta-faint)
    248       (fnname magenta)
    249       (keyword magenta-cooler)
    250       (preprocessor red-cooler)
    251       (string blue-warmer)
    252       (type cyan-cooler)
    253       (variable cyan)
    254       (rx-construct green-cooler)
    255       (rx-backslash magenta)
    256 
    257 ;;;; Accent mappings
    258 
    259       (accent-0 blue)
    260       (accent-1 magenta-warmer)
    261       (accent-2 cyan)
    262       (accent-3 red)
    263 
    264 ;;;; Button mappings
    265 
    266       (fg-button-active fg-main)
    267       (fg-button-inactive fg-dim)
    268       (bg-button-active bg-active)
    269       (bg-button-inactive bg-dim)
    270 
    271 ;;;; Completion mappings
    272 
    273       (fg-completion-match-0 blue)
    274       (fg-completion-match-1 magenta-warmer)
    275       (fg-completion-match-2 cyan)
    276       (fg-completion-match-3 red)
    277       (bg-completion-match-0 unspecified)
    278       (bg-completion-match-1 unspecified)
    279       (bg-completion-match-2 unspecified)
    280       (bg-completion-match-3 unspecified)
    281 
    282 ;;;; Date mappings
    283 
    284       (date-common cyan)
    285       (date-deadline red)
    286       (date-event fg-alt)
    287       (date-holiday red-cooler)
    288       (date-holiday-other blue)
    289       (date-now fg-main)
    290       (date-range fg-alt)
    291       (date-scheduled yellow-warmer)
    292       (date-weekday cyan)
    293       (date-weekend red-faint)
    294 
    295 ;;;; Line number mappings
    296 
    297       (fg-line-number-inactive fg-dim)
    298       (fg-line-number-active fg-main)
    299       (bg-line-number-inactive bg-dim)
    300       (bg-line-number-active bg-active)
    301 
    302 ;;;; Link mappings
    303 
    304       (fg-link blue-warmer)
    305       (bg-link unspecified)
    306       (underline-link blue-warmer)
    307 
    308       (fg-link-symbolic cyan)
    309       (bg-link-symbolic unspecified)
    310       (underline-link-symbolic cyan)
    311 
    312       (fg-link-visited magenta)
    313       (bg-link-visited unspecified)
    314       (underline-link-visited magenta)
    315 
    316 ;;;; Mail mappings
    317 
    318       (mail-cite-0 blue-faint)
    319       (mail-cite-1 yellow-warmer)
    320       (mail-cite-2 cyan-cooler)
    321       (mail-cite-3 red-cooler)
    322       (mail-part cyan)
    323       (mail-recipient magenta-cooler)
    324       (mail-subject magenta-warmer)
    325       (mail-other magenta-faint)
    326 
    327 ;;;; Mark mappings
    328 
    329       (bg-mark-delete bg-red-subtle)
    330       (fg-mark-delete red)
    331       (bg-mark-select bg-cyan-subtle)
    332       (fg-mark-select cyan)
    333       (bg-mark-other bg-yellow-subtle)
    334       (fg-mark-other yellow)
    335 
    336 ;;;; Prompt mappings
    337 
    338       (fg-prompt cyan-cooler)
    339       (bg-prompt unspecified)
    340 
    341 ;;;; Prose mappings
    342 
    343       (prose-block fg-dim)
    344       (prose-code green-cooler)
    345       (prose-done green)
    346       (prose-macro magenta-cooler)
    347       (prose-metadata fg-dim)
    348       (prose-metadata-value fg-alt)
    349       (prose-table fg-alt)
    350       (prose-tag magenta-faint)
    351       (prose-todo red)
    352       (prose-verbatim magenta-warmer)
    353 
    354 ;;;; Rainbow mappings
    355 
    356       (rainbow-0 fg-main)
    357       (rainbow-1 magenta-intense)
    358       (rainbow-2 cyan-intense)
    359       (rainbow-3 red-warmer)
    360       (rainbow-4 yellow-intense)
    361       (rainbow-5 magenta-cooler)
    362       (rainbow-6 green-intense)
    363       (rainbow-7 blue-warmer)
    364       (rainbow-8 magenta-warmer)
    365 
    366 ;;;; Space mappings
    367 
    368       (bg-space unspecified)
    369       (fg-space border)
    370       (bg-space-err bg-red-intense)
    371 
    372 ;;;; Terminal mappings
    373 
    374       (bg-term-black           "black")
    375       (fg-term-black           "black")
    376       (bg-term-black-bright    "gray35")
    377       (fg-term-black-bright    "gray35")
    378 
    379       (bg-term-red             red)
    380       (fg-term-red             red)
    381       (bg-term-red-bright      red-warmer)
    382       (fg-term-red-bright      red-warmer)
    383 
    384       (bg-term-green           green)
    385       (fg-term-green           green)
    386       (bg-term-green-bright    green-cooler)
    387       (fg-term-green-bright    green-cooler)
    388 
    389       (bg-term-yellow          yellow)
    390       (fg-term-yellow          yellow)
    391       (bg-term-yellow-bright   yellow-warmer)
    392       (fg-term-yellow-bright   yellow-warmer)
    393 
    394       (bg-term-blue            blue)
    395       (fg-term-blue            blue)
    396       (bg-term-blue-bright     blue-warmer)
    397       (fg-term-blue-bright     blue-warmer)
    398 
    399       (bg-term-magenta         magenta)
    400       (fg-term-magenta         magenta)
    401       (bg-term-magenta-bright  magenta-cooler)
    402       (fg-term-magenta-bright  magenta-cooler)
    403 
    404       (bg-term-cyan            cyan)
    405       (fg-term-cyan            cyan)
    406       (bg-term-cyan-bright     cyan-cooler)
    407       (fg-term-cyan-bright     cyan-cooler)
    408 
    409       (bg-term-white           "gray65")
    410       (fg-term-white           "gray65")
    411       (bg-term-white-bright    "white")
    412       (fg-term-white-bright    "white")
    413 
    414 ;;;; Heading mappings
    415 
    416       (fg-heading-0 cyan-cooler)
    417       (fg-heading-1 fg-main)
    418       (fg-heading-2 yellow-faint)
    419       (fg-heading-3 fg-alt)
    420       (fg-heading-4 magenta)
    421       (fg-heading-5 green-faint)
    422       (fg-heading-6 red-faint)
    423       (fg-heading-7 cyan-warmer)
    424       (fg-heading-8 fg-dim)
    425 
    426       (bg-heading-0 unspecified)
    427       (bg-heading-1 unspecified)
    428       (bg-heading-2 unspecified)
    429       (bg-heading-3 unspecified)
    430       (bg-heading-4 unspecified)
    431       (bg-heading-5 unspecified)
    432       (bg-heading-6 unspecified)
    433       (bg-heading-7 unspecified)
    434       (bg-heading-8 unspecified)
    435 
    436       (overline-heading-0 unspecified)
    437       (overline-heading-1 unspecified)
    438       (overline-heading-2 unspecified)
    439       (overline-heading-3 unspecified)
    440       (overline-heading-4 unspecified)
    441       (overline-heading-5 unspecified)
    442       (overline-heading-6 unspecified)
    443       (overline-heading-7 unspecified)
    444       (overline-heading-8 unspecified))
    445     "The entire palette of the `modus-operandi-tinted' theme.
    446 
    447 Named colors have the form (COLOR-NAME HEX-VALUE) with the former
    448 as a symbol and the latter as a string.
    449 
    450 Semantic color mappings have the form (MAPPING-NAME COLOR-NAME)
    451 with both as symbols.  The latter is a named color that already
    452 exists in the palette and is associated with a HEX-VALUE.")
    453 
    454   (defcustom modus-operandi-tinted-palette-overrides nil
    455     "Overrides for `modus-operandi-tinted-palette'.
    456 
    457 Mirror the elements of the aforementioned palette, overriding
    458 their value.
    459 
    460 For overrides that are shared across all of the Modus themes,
    461 refer to `modus-themes-common-palette-overrides'.
    462 
    463 Theme-specific overrides take precedence over shared overrides.
    464 The idea of common overrides is to change semantic color
    465 mappings, such as to make the cursor red.  Wherea theme-specific
    466 overrides can also be used to change the value of a named color,
    467 such as what hexadecimal RGB value the red-warmer symbol
    468 represents."
    469     :group 'modus-themes
    470     :package-version '(modus-themes . "4.0.0")
    471     :version "30.1"
    472     :type '(repeat (list symbol (choice symbol string)))
    473     :set #'modus-themes--set-option
    474     :initialize #'custom-initialize-default
    475     :link '(info-link "(modus-themes) Palette overrides"))
    476 
    477   (modus-themes-theme modus-operandi-tinted
    478                       modus-operandi-tinted-palette
    479                       modus-operandi-tinted-palette-overrides)
    480 
    481   (provide-theme 'modus-operandi-tinted))
    482 
    483 ;;; modus-operandi-tinted-theme.el ends here