dotemacs

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

modus-vivendi-theme.el (14987B)


      1 ;;; modus-vivendi-theme.el --- Elegant, highly legible theme with a black 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-vivendi
     47     "Elegant, highly legible theme with a black 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 'dark
     53     :kind 'color-scheme
     54     :family 'modus)
     55 
     56   (defconst modus-vivendi-palette
     57     '(
     58 ;;; Basic values
     59 
     60       (bg-main          "#000000")
     61       (bg-dim           "#1e1e1e")
     62       (fg-main          "#ffffff")
     63       (fg-dim           "#989898")
     64       (fg-alt           "#c6daff")
     65       (bg-active        "#535353")
     66       (bg-inactive      "#303030")
     67       (border           "#646464")
     68 
     69 ;;; Common accent foregrounds
     70 
     71       (red             "#ff5f59")
     72       (red-warmer      "#ff6b55")
     73       (red-cooler      "#ff7f9f")
     74       (red-faint       "#ff9580")
     75       (red-intense     "#ff5f5f")
     76       (green           "#44bc44")
     77       (green-warmer    "#70b900")
     78       (green-cooler    "#00c06f")
     79       (green-faint     "#88ca9f")
     80       (green-intense   "#44df44")
     81       (yellow          "#d0bc00")
     82       (yellow-warmer   "#fec43f")
     83       (yellow-cooler   "#dfaf7a")
     84       (yellow-faint    "#d2b580")
     85       (yellow-intense  "#efef00")
     86       (blue            "#2fafff")
     87       (blue-warmer     "#79a8ff")
     88       (blue-cooler     "#00bcff")
     89       (blue-faint      "#82b0ec")
     90       (blue-intense    "#338fff")
     91       (magenta         "#feacd0")
     92       (magenta-warmer  "#f78fe7")
     93       (magenta-cooler  "#b6a0ff")
     94       (magenta-faint   "#caa6df")
     95       (magenta-intense "#ff66ff")
     96       (cyan            "#00d3d0")
     97       (cyan-warmer     "#4ae2f0")
     98       (cyan-cooler     "#6ae4b9")
     99       (cyan-faint      "#9ac8e0")
    100       (cyan-intense    "#00eff0")
    101 
    102 ;;; Uncommon accent foregrounds
    103 
    104       (rust       "#db7b5f")
    105       (gold       "#c0965b")
    106       (olive      "#9cbd6f")
    107       (slate      "#76afbf")
    108       (indigo     "#9099d9")
    109       (maroon     "#cf7fa7")
    110       (pink       "#d09dc0")
    111 
    112 ;;; Common accent backgrounds
    113 
    114       (bg-red-intense     "#9d1f1f")
    115       (bg-green-intense   "#2f822f")
    116       (bg-yellow-intense  "#7a6100")
    117       (bg-blue-intense    "#1640b0")
    118       (bg-magenta-intense "#7030af")
    119       (bg-cyan-intense    "#2266ae")
    120 
    121       (bg-red-subtle      "#620f2a")
    122       (bg-green-subtle    "#00422a")
    123       (bg-yellow-subtle   "#4a4000")
    124       (bg-blue-subtle     "#242679")
    125       (bg-magenta-subtle  "#552f5f")
    126       (bg-cyan-subtle     "#004065")
    127 
    128       (bg-red-nuanced     "#3a0c14")
    129       (bg-green-nuanced   "#092f1f")
    130       (bg-yellow-nuanced  "#381d0f")
    131       (bg-blue-nuanced    "#12154a")
    132       (bg-magenta-nuanced "#2f0c3f")
    133       (bg-cyan-nuanced    "#042837")
    134 
    135 ;;; Uncommon accent backgrounds
    136 
    137       (bg-ochre    "#442c2f")
    138       (bg-lavender "#38325c")
    139       (bg-sage     "#0f3d30")
    140 
    141 ;;; Graphs
    142 
    143       (bg-graph-red-0     "#b52c2c")
    144       (bg-graph-red-1     "#702020")
    145       (bg-graph-green-0   "#0fed00")
    146       (bg-graph-green-1   "#007800")
    147       (bg-graph-yellow-0  "#f1e00a")
    148       (bg-graph-yellow-1  "#b08940")
    149       (bg-graph-blue-0    "#2fafef")
    150       (bg-graph-blue-1    "#1f2f8f")
    151       (bg-graph-magenta-0 "#bf94fe")
    152       (bg-graph-magenta-1 "#5f509f")
    153       (bg-graph-cyan-0    "#47dfea")
    154       (bg-graph-cyan-1    "#00808f")
    155 
    156 ;;; Special purpose
    157 
    158       (bg-completion       "#2f447f")
    159       (bg-hover            "#45605e")
    160       (bg-hover-secondary  "#654a39")
    161       (bg-hl-line          "#2f3849")
    162       (bg-region           "#5a5a5a")
    163       (fg-region           "#ffffff")
    164 
    165       (bg-char-0 "#0050af")
    166       (bg-char-1 "#7f1f7f")
    167       (bg-char-2 "#625a00")
    168 
    169       (bg-mode-line-active        "#505050")
    170       (fg-mode-line-active        "#ffffff")
    171       (border-mode-line-active    "#959595")
    172       (bg-mode-line-inactive      "#2d2d2d")
    173       (fg-mode-line-inactive      "#969696")
    174       (border-mode-line-inactive  "#606060")
    175 
    176       (modeline-err     "#ffa9bf")
    177       (modeline-warning "#dfcf43")
    178       (modeline-info    "#9fefff")
    179 
    180       (bg-tab-bar      "#313131")
    181       (bg-tab-current  "#000000")
    182       (bg-tab-other    "#545454")
    183 
    184 ;;; Diffs
    185 
    186       (bg-added           "#00381f")
    187       (bg-added-faint     "#002910")
    188       (bg-added-refine    "#034f2f")
    189       (bg-added-fringe    "#237f3f")
    190       (fg-added           "#a0e0a0")
    191       (fg-added-intense   "#80e080")
    192 
    193       (bg-changed         "#363300")
    194       (bg-changed-faint   "#2a1f00")
    195       (bg-changed-refine  "#4a4a00")
    196       (bg-changed-fringe  "#8a7a00")
    197       (fg-changed         "#efef80")
    198       (fg-changed-intense "#c0b05f")
    199 
    200       (bg-removed         "#4f1119")
    201       (bg-removed-faint   "#380a0f")
    202       (bg-removed-refine  "#781a1f")
    203       (bg-removed-fringe  "#b81a1f")
    204       (fg-removed         "#ffbfbf")
    205       (fg-removed-intense "#ff9095")
    206 
    207       (bg-diff-context    "#1a1a1a")
    208 
    209 ;;; Paren match
    210 
    211       (bg-paren-match        "#2f7f9f")
    212       (fg-paren-match        fg-main)
    213       (bg-paren-expression   "#453040")
    214       (underline-paren-match unspecified)
    215 
    216 ;;; Mappings
    217 
    218 ;;;; General mappings
    219 
    220       (fringe bg-dim)
    221       (cursor fg-main)
    222 
    223       (keybind blue-cooler)
    224       (name magenta)
    225       (identifier yellow-faint)
    226 
    227       (err red)
    228       (warning yellow-warmer)
    229       (info cyan-cooler)
    230 
    231       (underline-err red-intense)
    232       (underline-warning yellow)
    233       (underline-note cyan)
    234 
    235       (bg-prominent-err bg-red-intense)
    236       (fg-prominent-err fg-main)
    237       (bg-prominent-warning bg-yellow-intense)
    238       (fg-prominent-warning fg-main)
    239       (bg-prominent-note bg-cyan-intense)
    240       (fg-prominent-note fg-main)
    241 
    242       (bg-active-argument bg-yellow-nuanced)
    243       (fg-active-argument yellow-cooler)
    244       (bg-active-value bg-cyan-nuanced)
    245       (fg-active-value cyan-cooler)
    246 
    247 ;;;; Code mappings
    248 
    249       (builtin magenta-warmer)
    250       (comment fg-dim)
    251       (constant blue-cooler)
    252       (docstring cyan-faint)
    253       (docmarkup magenta-faint)
    254       (fnname magenta)
    255       (keyword magenta-cooler)
    256       (preprocessor red-cooler)
    257       (string blue-warmer)
    258       (type cyan-cooler)
    259       (variable cyan)
    260       (rx-construct green-cooler)
    261       (rx-backslash magenta)
    262 
    263 ;;;; Accent mappings
    264 
    265       (accent-0 blue-cooler)
    266       (accent-1 magenta-warmer)
    267       (accent-2 cyan-cooler)
    268       (accent-3 yellow)
    269 
    270 ;;;; Button mappings
    271 
    272       (fg-button-active fg-main)
    273       (fg-button-inactive fg-dim)
    274       (bg-button-active bg-active)
    275       (bg-button-inactive bg-dim)
    276 
    277 ;;;; Completion mappings
    278 
    279       (fg-completion-match-0 blue-cooler)
    280       (fg-completion-match-1 magenta-warmer)
    281       (fg-completion-match-2 cyan-cooler)
    282       (fg-completion-match-3 yellow)
    283       (bg-completion-match-0 unspecified)
    284       (bg-completion-match-1 unspecified)
    285       (bg-completion-match-2 unspecified)
    286       (bg-completion-match-3 unspecified)
    287 
    288 ;;;; Date mappings
    289 
    290       (date-common cyan)
    291       (date-deadline red)
    292       (date-event fg-alt)
    293       (date-holiday red-cooler)
    294       (date-holiday-other blue)
    295       (date-now fg-main)
    296       (date-range fg-alt)
    297       (date-scheduled yellow-warmer)
    298       (date-weekday cyan)
    299       (date-weekend red-faint)
    300 
    301 ;;;; Line number mappings
    302 
    303       (fg-line-number-inactive fg-dim)
    304       (fg-line-number-active fg-main)
    305       (bg-line-number-inactive bg-dim)
    306       (bg-line-number-active bg-active)
    307 
    308 ;;;; Link mappings
    309 
    310       (fg-link blue-warmer)
    311       (bg-link unspecified)
    312       (underline-link blue-warmer)
    313 
    314       (fg-link-symbolic cyan)
    315       (bg-link-symbolic unspecified)
    316       (underline-link-symbolic cyan)
    317 
    318       (fg-link-visited magenta)
    319       (bg-link-visited unspecified)
    320       (underline-link-visited magenta)
    321 
    322 ;;;; Mail mappings
    323 
    324       (mail-cite-0 blue-warmer)
    325       (mail-cite-1 yellow-cooler)
    326       (mail-cite-2 cyan-cooler)
    327       (mail-cite-3 red-cooler)
    328       (mail-part blue)
    329       (mail-recipient magenta-cooler)
    330       (mail-subject magenta-warmer)
    331       (mail-other magenta-faint)
    332 
    333 ;;;; Mark mappings
    334 
    335       (bg-mark-delete bg-red-subtle)
    336       (fg-mark-delete red-cooler)
    337       (bg-mark-select bg-cyan-subtle)
    338       (fg-mark-select cyan)
    339       (bg-mark-other bg-yellow-subtle)
    340       (fg-mark-other yellow)
    341 
    342 ;;;; Prompt mappings
    343 
    344       (fg-prompt cyan-cooler)
    345       (bg-prompt unspecified)
    346 
    347 ;;;; Prose mappings
    348 
    349       (bg-prose-block-delimiter bg-dim)
    350       (fg-prose-block-delimiter fg-dim)
    351       (bg-prose-block-contents bg-dim)
    352 
    353       (bg-prose-code unspecified)
    354       (fg-prose-code cyan-cooler)
    355 
    356       (bg-prose-macro unspecified)
    357       (fg-prose-macro magenta-cooler)
    358 
    359       (bg-prose-verbatim unspecified)
    360       (fg-prose-verbatim magenta-warmer)
    361 
    362       (prose-done green)
    363       (prose-todo red)
    364 
    365       (prose-metadata fg-dim)
    366       (prose-metadata-value fg-alt)
    367 
    368       (prose-table fg-alt)
    369       (prose-table-formula magenta-warmer)
    370 
    371       (prose-tag magenta-faint)
    372 
    373 ;;;; Rainbow mappings
    374 
    375       (rainbow-0 fg-main)
    376       (rainbow-1 magenta-intense)
    377       (rainbow-2 cyan-intense)
    378       (rainbow-3 red-warmer)
    379       (rainbow-4 yellow-intense)
    380       (rainbow-5 magenta-cooler)
    381       (rainbow-6 green-intense)
    382       (rainbow-7 blue-warmer)
    383       (rainbow-8 magenta-warmer)
    384 
    385 ;;;; Search mappings
    386 
    387       (bg-search-current bg-yellow-intense)
    388       (bg-search-lazy bg-cyan-intense)
    389       (bg-search-replace bg-red-intense)
    390 
    391       (bg-search-rx-group-0 bg-blue-intense)
    392       (bg-search-rx-group-1 bg-green-intense)
    393       (bg-search-rx-group-2 bg-red-subtle)
    394       (bg-search-rx-group-3 bg-magenta-subtle)
    395 
    396 ;;;; Space mappings
    397 
    398       (bg-space unspecified)
    399       (fg-space border)
    400       (bg-space-err bg-red-intense)
    401 
    402 ;;;; Terminal mappings
    403 
    404       (bg-term-black           "#000000")
    405       (fg-term-black           "#000000")
    406       (bg-term-black-bright    "#595959")
    407       (fg-term-black-bright    "#595959")
    408 
    409       (bg-term-red             red)
    410       (fg-term-red             red)
    411       (bg-term-red-bright      red-warmer)
    412       (fg-term-red-bright      red-warmer)
    413 
    414       (bg-term-green           green)
    415       (fg-term-green           green)
    416       (bg-term-green-bright    green-cooler)
    417       (fg-term-green-bright    green-cooler)
    418 
    419       (bg-term-yellow          yellow)
    420       (fg-term-yellow          yellow)
    421       (bg-term-yellow-bright   yellow-warmer)
    422       (fg-term-yellow-bright   yellow-warmer)
    423 
    424       (bg-term-blue            blue)
    425       (fg-term-blue            blue)
    426       (bg-term-blue-bright     blue-warmer)
    427       (fg-term-blue-bright     blue-warmer)
    428 
    429       (bg-term-magenta         magenta)
    430       (fg-term-magenta         magenta)
    431       (bg-term-magenta-bright  magenta-cooler)
    432       (fg-term-magenta-bright  magenta-cooler)
    433 
    434       (bg-term-cyan            cyan)
    435       (fg-term-cyan            cyan)
    436       (bg-term-cyan-bright     cyan-cooler)
    437       (fg-term-cyan-bright     cyan-cooler)
    438 
    439       (bg-term-white           "#a6a6a6")
    440       (fg-term-white           "#a6a6a6")
    441       (bg-term-white-bright    "#ffffff")
    442       (fg-term-white-bright    "#ffffff")
    443 
    444 ;;;; Heading mappings
    445 
    446       (fg-heading-0 cyan-cooler)
    447       (fg-heading-1 fg-main)
    448       (fg-heading-2 yellow-faint)
    449       (fg-heading-3 blue-faint)
    450       (fg-heading-4 magenta)
    451       (fg-heading-5 green-faint)
    452       (fg-heading-6 red-faint)
    453       (fg-heading-7 cyan-faint)
    454       (fg-heading-8 fg-dim)
    455 
    456       (bg-heading-0 unspecified)
    457       (bg-heading-1 unspecified)
    458       (bg-heading-2 unspecified)
    459       (bg-heading-3 unspecified)
    460       (bg-heading-4 unspecified)
    461       (bg-heading-5 unspecified)
    462       (bg-heading-6 unspecified)
    463       (bg-heading-7 unspecified)
    464       (bg-heading-8 unspecified)
    465 
    466       (overline-heading-0 unspecified)
    467       (overline-heading-1 unspecified)
    468       (overline-heading-2 unspecified)
    469       (overline-heading-3 unspecified)
    470       (overline-heading-4 unspecified)
    471       (overline-heading-5 unspecified)
    472       (overline-heading-6 unspecified)
    473       (overline-heading-7 unspecified)
    474       (overline-heading-8 unspecified))
    475     "The entire palette of the `modus-vivendi' theme.
    476 
    477 Named colors have the form (COLOR-NAME HEX-VALUE) with the former
    478 as a symbol and the latter as a string.
    479 
    480 Semantic color mappings have the form (MAPPING-NAME COLOR-NAME)
    481 with both as symbols.  The latter is a named color that already
    482 exists in the palette and is associated with a HEX-VALUE.")
    483 
    484   (defcustom modus-vivendi-palette-overrides nil
    485     "Overrides for `modus-vivendi-palette'.
    486 
    487 Mirror the elements of the aforementioned palette, overriding
    488 their value.
    489 
    490 For overrides that are shared across all of the Modus themes,
    491 refer to `modus-themes-common-palette-overrides'.
    492 
    493 Theme-specific overrides take precedence over shared overrides.
    494 The idea of common overrides is to change semantic color
    495 mappings, such as to make the cursor red.  Wherea theme-specific
    496 overrides can also be used to change the value of a named color,
    497 such as what hexadecimal RGB value the red-warmer symbol
    498 represents."
    499     :group 'modus-themes
    500     :package-version '(modus-themes . "4.0.0")
    501     :version "30.1"
    502     :type '(repeat (list symbol (choice symbol string)))
    503     :set #'modus-themes--set-option
    504     :initialize #'custom-initialize-default
    505     :link '(info-link "(modus-themes) Palette overrides"))
    506 
    507   (modus-themes-theme modus-vivendi
    508                       modus-vivendi-palette
    509                       modus-vivendi-palette-overrides)
    510 
    511   (provide-theme 'modus-vivendi))
    512 
    513 ;;; modus-vivendi-theme.el ends here