dotemacs

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

modus-vivendi-theme.el (14232B)


      1 ;;; modus-vivendi-theme.el --- Elegant, highly legible theme with a black 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-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     "#2c0614")
    129       (bg-green-nuanced   "#001904")
    130       (bg-yellow-nuanced  "#221000")
    131       (bg-blue-nuanced    "#0f0e39")
    132       (bg-magenta-nuanced "#230631")
    133       (bg-cyan-nuanced    "#041529")
    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       (bg-paren-expression   "#453040")
    213       (underline-paren-match unspecified)
    214 
    215 ;;; Mappings
    216 
    217 ;;;; General mappings
    218 
    219       (fringe bg-dim)
    220       (cursor fg-main)
    221 
    222       (keybind blue-cooler)
    223       (name magenta)
    224       (identifier yellow-faint)
    225 
    226       (err red)
    227       (warning yellow-warmer)
    228       (info cyan-cooler)
    229 
    230       (underline-err red-intense)
    231       (underline-warning yellow)
    232       (underline-note cyan)
    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 fg-dim)
    245       (constant blue-cooler)
    246       (docstring cyan-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-cooler)
    260       (accent-1 magenta-warmer)
    261       (accent-2 cyan-cooler)
    262       (accent-3 yellow)
    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-cooler)
    274       (fg-completion-match-1 magenta-warmer)
    275       (fg-completion-match-2 cyan-cooler)
    276       (fg-completion-match-3 yellow)
    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-warmer)
    319       (mail-cite-1 yellow-cooler)
    320       (mail-cite-2 cyan-cooler)
    321       (mail-cite-3 red-cooler)
    322       (mail-part blue)
    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-cooler)
    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 cyan-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 blue-faint)
    420       (fg-heading-4 magenta)
    421       (fg-heading-5 green-faint)
    422       (fg-heading-6 red-faint)
    423       (fg-heading-7 cyan-faint)
    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-vivendi' 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 
    455   (defcustom modus-vivendi-palette-overrides nil
    456     "Overrides for `modus-vivendi-palette'.
    457 
    458 Mirror the elements of the aforementioned palette, overriding
    459 their value.
    460 
    461 For overrides that are shared across all of the Modus themes,
    462 refer to `modus-themes-common-palette-overrides'.
    463 
    464 Theme-specific overrides take precedence over shared overrides.
    465 The idea of common overrides is to change semantic color
    466 mappings, such as to make the cursor red.  Wherea theme-specific
    467 overrides can also be used to change the value of a named color,
    468 such as what hexadecimal RGB value the red-warmer symbol
    469 represents."
    470     :group 'modus-themes
    471     :package-version '(modus-themes . "4.0.0")
    472     :version "30.1"
    473     :type '(repeat (list symbol (choice symbol string)))
    474     :set #'modus-themes--set-option
    475     :initialize #'custom-initialize-default
    476     :link '(info-link "(modus-themes) Palette overrides"))
    477 
    478   (modus-themes-theme modus-vivendi
    479                       modus-vivendi-palette
    480                       modus-vivendi-palette-overrides)
    481 
    482   (provide-theme 'modus-vivendi))
    483 
    484 ;;; modus-vivendi-theme.el ends here