This is modus-themes.info, produced by makeinfo version 7.1.1 from
modus-themes.texi.

Copyright (C) 2020-2026 Free Software Foundation, Inc.

     Permission is granted to copy, distribute and/or modify this
     document under the terms of the GNU Free Documentation License,
     Version 1.3 or any later version published by the Free Software
     Foundation; with no Invariant Sections, with the Front-Cover Texts
     being “A GNU Manual,” and with the Back-Cover Texts as in (a)
     below.  A copy of the license is included in the section entitled
     “GNU Free Documentation License.”

     (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and
     modify this GNU manual.”

INFO-DIR-SECTION Emacs misc features
START-INFO-DIR-ENTRY
* Modus Themes: (modus-themes). Elegant, highly legible and customizable themes.
END-INFO-DIR-ENTRY


File: modus-themes.info,  Node: Top,  Next: Overview,  Up: (dir)

Modus themes for GNU Emacs
**************************

Copyright (C) 2020-2026 Free Software Foundation, Inc.

     Permission is granted to copy, distribute and/or modify this
     document under the terms of the GNU Free Documentation License,
     Version 1.3 or any later version published by the Free Software
     Foundation; with no Invariant Sections, with the Front-Cover Texts
     being “A GNU Manual,” and with the Back-Cover Texts as in (a)
     below.  A copy of the license is included in the section entitled
     “GNU Free Documentation License.”

     (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and
     modify this GNU manual.”

   This manual, written by Protesilaos, describes the customization
options for the Modus themes, and provides every other piece of
information pertinent to them.

   The documentation furnished herein corresponds to stable version
5.3.0, released on 2026-06-21.  Any reference to a newer feature which
does not yet form part of the latest tagged commit, is explicitly marked
as such.

   Current development target is 5.4.0-dev.

   • Package name (GNU ELPA): ‘modus-themes’
   • Official manual: <https://protesilaos.com/emacs/modus-themes>
   • Change log: <https://protesilaos.com/emacs/modus-themes-changelog>
   • Color palette: <https://protesilaos.com/emacs/modus-themes-colors>
   • Sample pictures:
     <https://protesilaos.com/emacs/modus-themes-pictures>
   • Git repositories:
        • GitHub: <https://github.com/protesilaos/modus-themes>
        • GitLab: <https://gitlab.com/protesilaos/modus-themes>
   • Backronym: My Old Display Unexpectedly Sharpened ... themes.

* Menu:

* Overview::
* Installation::
* Sample configuration::
* Enable and load::
* Customization options::
* Preview theme colors::
* Use colors from the Modus themes palette::
* Advanced customization::
* Build on top of the Modus themes::
* Face coverage::
* Notes on individual packages::
* Frequently Asked Questions::
* Contributing::
* Acknowledgements::
* GNU Free Documentation License::
* Indices::

-- The Detailed Node Listing --

Overview

* How do the themes look like::
* Learn about the latest changes::

Installation

* Install manually from source::
* Install from source with package-vc-install::
* Install from GNU ELPA::
* Dealing with byte compilation errors::

Sample configuration

* The require-theme for built-in Emacs themes::

Enable and load

* Difference between loading and enabling::

Customization options

* Disable other themes::         Determine whether loading a Modus themes disables all others
* Bold constructs::              Toggle bold constructs in code
* Italic constructs::            Toggle italic font constructs in code
* Option for which themes to toggle::
* Option for which themes to rotate::
* Mixed fonts::                  Toggle mixing of font families
* Org mode blocks::              Choose among plain, gray, or tinted backgrounds
* Heading styles::               Choose among several styles, also per heading level
* UI typeface::                  Toggle the use of variable-pitch across the User Interface
* Palette overrides::            Refashion color values and/or semantic color mappings
* Palette extension::            Define new colors and use them like the original ones

Preview theme colors

* Commands for the preview palette buffer::

Use colors from the Modus themes palette

* Get a single color from the palette with modus-themes-get-color-value::
* Use theme colors in code with modus-themes-with-colors::

Advanced customization

* DIY Palette override presets::
* DIY Add support for vc-annotate::
* DIY Add support for engrave-faces::
* DIY Stylistic variants using palette overrides::
* DIY More accurate colors in terminal emulators::
* DIY Range of color with terminal emulators::
* DIY Per-theme customization settings::
* DIY Do not extend the region background::
* DIY Add padding to the mode line::
* DIY Remap face with local value::
* DIY Font configurations for Org and others::
* DIY Configure bold and italic faces::
* DIY Custom Org todo keyword and priority faces::
* DIY Custom Org emphasis faces::
* DIY Use colored Org source blocks per language::
* DIY Measure color contrast::
* DIY Load theme depending on time of day::
* DIY Backdrop for pdf-tools::
* DIY Toggle themes without reloading them::
* DIY Use more spacious margins or padding in Emacs frames::
* DIY Custom hl-todo colors::
* DIY Add support for solaire-mode::
* DIY Add support for meow-mode::
* DIY Add support for combobulate::
* DIY Use a hook at the post-load-theme phase::

DIY Stylistic variants using palette overrides

* DIY Make the mode line borderless::
* DIY Make the active mode line colorful::
* DIY Make the tab bar more or less colorful::
* DIY Make the fringe invisible or another color::
* DIY Make links use subtle or no underlines::
* DIY Make prompts more or less colorful::
* DIY Make completion matches more or less colorful::
* DIY Make comments yellow and strings green::
* DIY Make code syntax use the old alt-syntax style::
* DIY Make use of alternative styles for code syntax::
* DIY Make matching parenthesis more or less intense::
* DIY Make box buttons more or less gray::
* DIY Make TODO and DONE more or less intense::
* DIY Make headings more or less colorful::
* DIY Make Org block colors more or less colorful::
* DIY Make Org agenda more or less colorful::
* DIY Make inline code in prose use alternative styles::
* DIY Make mail citations and headers more or less colorful::
* DIY Make the region preserve text colors, plus other styles: DIY Make the region preserve text colors plus other styles.
* DIY Make mouse highlights more or less colorful::
* DIY Make language underlines less colorful::
* DIY Make line numbers use alternative styles::
* DIY Make diffs use only a foreground::
* DIY Make deuteranopia diffs red and blue instead of yellow and blue::

DIY Use a hook at the post-load-theme phase

* DIY A theme-agnostic hook for theme loading::

Build on top of the Modus themes

* Complete example of a Modus derivative theme::
* Determine what counts as a Modus theme::
* Create convenience commands to load a derivative theme::
* Arrange to activate your derivative themes::

Complete example of a Modus derivative theme

* Complete example of a package that is derived from Modus::
* Complete example of a private theme derived from Modus::
* Complete example of a custom theme with its own palette::
* Complete example that also uses modus-themes-generate-palette::

Face coverage

* Supported packages::           Full list of covered face groups
* Indirectly covered packages::

Notes on individual packages

* Note on calendar.el weekday and weekend colors: Note on calendarel weekday and weekend colors.
* Note on git-gutter in Doom Emacs::
* Note on php-mode multiline comments::
* Note on underlines in compilation buffers::
* Note on inline Latex in Org buffers::
* Note on dimmer.el: Note on dimmerel.
* Note on display-fill-column-indicator-mode::
* Note on highlight-parentheses.el: Note on highlight-parenthesesel.
* Note on mmm-mode.el background colors: Note on mmm-modeel background colors.
* Note for prism::
* Note on company-mode overlay pop-up::
* Note on ERC escaped color sequences::
* Note on powerline or spaceline::
* Note on SHR colors::
* Note on SHR fonts::
* Note on Ement colors and fonts::
* Note on pdf-tools link hints::
* Note on the Notmuch logo::
* Note on goto-address-mode faces::

Frequently Asked Questions

* Is the contrast ratio about adjacent colors?::
* What does it mean to avoid exaggerations?::
* Why are colors mostly variants of blue, magenta, cyan?: Why are colors mostly variants of blue magenta cyan?.
* What is the best setup for legibility?::
* Are these color schemes?::
* Port the Modus themes to other platforms?::

Contributing

* Sources of the themes::
* Issues you can help with::
* Patches require copyright assignment to the FSF::

Indices

* Function index::
* Variable index::
* Concept index::



File: modus-themes.info,  Node: Overview,  Next: Installation,  Prev: Top,  Up: Top

1 Overview
**********

The Modus themes are designed for accessible readability.  They conform
with the highest standard for color contrast between combinations of
background and foreground values.  For small sized text, this
corresponds to the WCAG AAA standard, which specifies a minimum rate of
distance in relative luminance of 7:1.

   The Modus themes consist of eight themes, divided into four
subgroups.

Main themes
     ‘modus-operandi’ is the project's main light theme, while
     ‘modus-vivendi’ is its dark counterpart.  These two themes are part
     of the project since its inception.  They are designed to cover a
     broad range of needs and are, in the opinion of the author, the
     reference for what a highly legible "default" theme should look
     like.

Tinted themes
     ‘modus-operandi-tinted’ and ‘modus-vivendi-tinted’ are variants of
     the two main themes.  They tone down the intensity of the
     background and rely on a marginally altered palette for stylistic
     harmony.  ‘modus-operandi-tinted’ has a set of base tones that are
     shades of light ochre (earthly colors), while
     ‘modus-vivendi-tinted’ gives a night sky impression.

Deuteranopia themes
     ‘modus-operandi-deuteranopia’ and its companion
     ‘modus-vivendi-deuteranopia’ are optimized for users with red-green
     color deficiency.  This means that they do not use red and green
     hues for color-coding purposes, such as for diff removed and added
     lines.  Instead, they implement colors that are discernible by
     users with deueteranopia or deuteranomaly (those colors are mostly
     shades of yellow and blue).

Tritanopia themes
     ‘modus-operandi-tritanopia’ and its counterpart
     ‘modus-vivendi-tritanopia’ are optimized for users with blue-yellow
     color deficiency.  The idea is the same as with the deuteranopia
     variants: color coding relies only on hues that are accessible to
     people with tritanopia or tritanomaly, namely, shades of red and
     cyan.

   To ensure that users have a consistently accessible experience, the
themes strive to achieve as close to full face coverage as possible,
while still targeting a curated list of well-maintained packages (*note
Face coverage::).

   The overarching objective of this project is to consistently offer
accessible color combinations.  There shall never be a compromise on
this principle.  If there arises an inescapable trade-off between
usability and stylistic considerations, I will always opt for the
former.

   Starting with version 0.12.0 and onwards, the themes are built into
GNU Emacs.

* Menu:

* How do the themes look like::
* Learn about the latest changes::


File: modus-themes.info,  Node: How do the themes look like,  Next: Learn about the latest changes,  Up: Overview

1.1 How do the themes look like
===============================

Check the web page with the screen shots
(https://protesilaos.com/emacs/modus-themes-pictures/).  Note that the
themes are highly customizable (*note Customization options::).


File: modus-themes.info,  Node: Learn about the latest changes,  Prev: How do the themes look like,  Up: Overview

1.2 Learn about the latest changes
==================================

Please refer to the web page with the change log
(https://protesilaos.com/emacs/modus-themes-changelog).  It is
comprehensive and covers everything that goes into each tagged release
of the themes.


File: modus-themes.info,  Node: Installation,  Next: Sample configuration,  Prev: Overview,  Up: Top

2 Installation
**************

The Modus themes are distributed with Emacs starting with version 28.1.
They are also available as a standalone package.

   Emacs 28 ships with ‘modus-themes’ version ‘1.6.0’.  Emacs 29
includes version ‘3.0.0’.  Emacs 30 provides version ‘4.4.0’, while
Emacs 31 has version ‘5.2.0’.

* Menu:

* Install manually from source::
* Install from source with package-vc-install::
* Install from GNU ELPA::
* Dealing with byte compilation errors::


File: modus-themes.info,  Node: Install manually from source,  Next: Install from source with package-vc-install,  Up: Installation

2.1 Install manually from source
================================

In the following example, I am assuming that your Emacs files are stored
in ‘~/.emacs.d’ and that you want to place the Modus themes in
‘~/.emacs.d/modus-themes’.  If you are using Emacs 29, you do not need
to do this manually (*note Install from source with
package-vc-install::).

  1. Get the source and store it in the desired path by running the
     following in the command line shell:

     $ git clone https://gitlab.com/protesilaos/modus-themes.git ~/.emacs.d/modus-themes

  1. Add that path to your known Elisp libraries' list, by placing this
     snippet of Emacs Lisp in your init file (e.g.  ‘init.el’):

     (add-to-list 'load-path "~/.emacs.d/modus-themes/")

   The themes are now ready to be used: *note Enable and load::.


File: modus-themes.info,  Node: Install from source with package-vc-install,  Next: Install from GNU ELPA,  Prev: Install manually from source,  Up: Installation

2.2 Install from source with ‘package-vc-install’
=================================================

Starting with Emacs version 29, you can install the ‘modus-themes’
directly from source with the function ‘package-vc-install’:

     ;; Install from source.  Do not do it if the package is already installed.
     ;;
     ;; To upgrade packages installed with `package-vc-install', use the
     ;; commands `package-vc-upgrade' or `package-vc-upgrade-all'.
     (unless (package-installed-p 'modus-themes)
       (package-vc-install "https://github.com/protesilaos/modus-themes.git"))


File: modus-themes.info,  Node: Install from GNU ELPA,  Next: Dealing with byte compilation errors,  Prev: Install from source with package-vc-install,  Up: Installation

2.3 Install from GNU ELPA
=========================

The ‘modus-themes’ package is available from the official GNU ELPA
archive.  Prior to querying any package archive, make sure to update the
index, with ‘M-x package-refresh-contents’.  Then all you need to do is
type ‘M-x package-install’ and specify the ‘modus-themes’ at the prompt.

   Once installed, the themes are ready for use: *note Enable and
load::.


File: modus-themes.info,  Node: Dealing with byte compilation errors,  Prev: Install from GNU ELPA,  Up: Installation

2.4 Dealing with byte compilation errors
========================================

From time to time, I receive bug reports pertaining to errors with byte
compilation.  These seldom have to do with faulty code in the themes: it
might be a shortcoming of ‘package.el’, some regression in the current
development target of Emacs, a misconfiguration in an otherwise exotic
setup, and the like.

   The common solution with a stable version of Emacs is to:

  1. Delete the ‘modus-themes’ package.
  2. Close the current Emacs session.
  3. Install the ‘modus-themes’ again.

   For those building Emacs directly from source, the solution may
involve reverting to an earlier commit in emacs.git.

   At any rate, if you encounter such an issue please report it: I will
either fix the bug or help forward it to the relevant upstream
maintainer.  Whatever you do, please understand that a build failure
does not mean I am necessarily doing something wrong.

   *note Issues you can help with::.


File: modus-themes.info,  Node: Sample configuration,  Next: Enable and load,  Prev: Installation,  Up: Top

3 Sample configuration
**********************

It is common for Emacs users to rely on ‘use-package’ to declare package
configurations (*note The require-theme for built-in Emacs themes::):

     (use-package modus-themes
       :ensure t
       :config
       ;; Your customizations here.  All customizations must be evaluated
       ;; BEFORE loading the theme.  Reload the theme for new customizations
       ;; to take effect.
       (setq modus-themes-italic-constructs t
             modus-themes-bold-constructs nil)

       (modus-themes-load-theme 'modus-operandi)

       (define-key global-map (kbd "<f5>") #'modus-themes-toggle))

   The same without ‘use-package’:

     (require 'modus-themes)

     ;; Your customizations here.  All customizations must be evaluated
     ;; BEFORE loading the theme.  Reload the theme for new customizations
     ;; to take effect.
     (setq modus-themes-italic-constructs t
           modus-themes-bold-constructs nil)

     (modus-themes-load-theme 'modus-operandi)

     (define-key global-map (kbd "<f5>") #'modus-themes-toggle)

   *note Difference between loading and enabling::.

   Note: make sure not to customize the variable
‘custom-theme-load-path’ or ‘custom-theme-directory’ after the themes'
package declaration.  That will lead to failures in loading the files.
If either or both of those variables need to be changed, their values
should be defined before the package declaration of the themes.

* Menu:

* The require-theme for built-in Emacs themes::


File: modus-themes.info,  Node: The require-theme for built-in Emacs themes,  Up: Sample configuration

3.1 The ‘require-theme’ for built-in Emacs themes
=================================================

The version of the Modus themes that is included in Emacs CANNOT use the
standard ‘require’ that ‘use-package’ calls internally.  This is because
the built-in themes are not included in the ‘load-path’ (not my
decision).  The ‘require-theme’ function must be used instead.  For
example:

     (require-theme 'modus-themes)

     ;; Your customizations here.  All customizations must be evaluated
     ;; BEFORE loading the theme.  Reload the theme for new customizations
     ;; to take effect.
     (setq modus-themes-bold-constructs t
           modus-themes-italic-constructs t)

     (modus-themes-load-theme 'modus-operandi)

     (define-key global-map (kbd "<f5>") #'modus-themes-toggle)

   Same principle but with ‘use-package’:

     (use-package emacs
       :init
       ;; `require-theme' is ONLY for the built-in Modus themes
       (require-theme 'modus-themes)
       :config
       ;; Your customizations here.  All customizations must be evaluated
       ;; BEFORE loading the theme.  Reload the theme for new customizations
       ;; to take effect.
       (setq modus-themes-italic-constructs t
             modus-themes-bold-constructs nil)

       (modus-themes-load-theme 'modus-operandi)

       (define-key global-map (kbd "<f5>") #'modus-themes-toggle))


File: modus-themes.info,  Node: Enable and load,  Next: Customization options,  Prev: Sample configuration,  Up: Top

4 Enable and load
*****************

Emacs provides the generic ‘load-theme’ function to load the given
theme.  Modus themes work with it as expected.  Though I also define the
function ‘modus-themes-load-theme’ which (i) calls the
‘modus-themes-after-load-theme-hook’ (alias
‘modus-themes-post-load-hook’) and (ii) disables all other color themes
if the relevant user option is enabled (*note Option to disable other
color themes when loading a Modus theme: Disable other themes.).

   The ‘modus-themes-after-load-theme-hook’ is specific to the Modus
themes.  As such, users can rely on it to work as expected with the
functions and macros that Modus defines (*note Advanced
customization::).

   The commands ‘modus-themes-toggle’, ‘modus-themes-rotate’,
‘modus-themes-load-random’, and ‘modus-themes-select’ use
‘modus-themes-load-theme’ internally:

‘modus-themes-toggle’
     Switches between two predefined Modus themes (*note Option for
     which themes to toggle::).

‘modus-themes-rotate’
     Cycles through a list of Modus themes in rotation from left to
     right (*note Option for which themes to rotate::).

‘modus-themes-select’
     Selects a Modus theme using the minibuffer.  When called with a
     prefix argument (‘C-u’ by default), it first prompts for a light or
     dark subset and then loads a theme accordingly.

‘modus-themes-load-random’
     Loads a Modus theme at random.  When called with a prefix argument,
     it prompts for the light or dark subset to load a theme from.

   Convenience commands for loading only dark or light themes are:

   • ‘modus-themes-select-dark’

   • ‘modus-themes-select-light’

   • ‘modus-themes-load-random-dark’

   • ‘modus-themes-load-random-light’

* Menu:

* Difference between loading and enabling::


File: modus-themes.info,  Node: Difference between loading and enabling,  Up: Enable and load

4.1 Difference between loading and enabling
===========================================

Emacs differentiates between loading, per ‘load-theme’, and enabling a
theme per ‘enable-theme’.  The former refers to the process of loading
and evaluating the theme.  While the latter is about moving the given
theme to the front of the ‘custom-enabled-themes’, without evaluating it
anew.

   Concretely, loading a theme always accounts for changes to user
options and thus updates the relevant styles accordingly (*note
Customization Options: Customization options.).  Whereas enabling a
theme will not perform any further computations.

   *note Toggle themes without reloading them: DIY Toggle themes without
reloading them.

   *note Sample configuration::.


File: modus-themes.info,  Node: Customization options,  Next: Preview theme colors,  Prev: Enable and load,  Up: Top

5 Customization options
***********************

The Modus themes are highly configurable, though they should work well
without any tweaks.  I provide a variety of user options, making these
perhaps the most customizable themes available.  The following code
block provides an overview.

   The Modus themes support palette overrides.  Those can be used to
make thoroughgoing changes to the looks of the themes, to the point
where a given theme looks completely different from how I have designed
it (*note Option for palette overrides: Palette overrides.).  I document
everything at length in the pages of this manual and also provide
ready-to-use code samples.

   Remember that all customization options must be evaluated before
loading a theme (*note Enable and load::).  If the theme is already
active, it must be reloaded for changes to take effect.

     ;; In all of the following, WEIGHT is a symbol such as `semibold',
     ;; `light', `bold', or anything mentioned in `modus-themes-weights'.
     (setq modus-themes-italic-constructs t
           modus-themes-bold-constructs nil
           modus-themes-mixed-fonts t
           modus-themes-variable-pitch-ui nil
           modus-themes-disable-other-themes t

           ;; The `modus-themes-headings' is an alist: read the manual's
           ;; node about it or its docstring.  Basically, it supports
           ;; per-level configurations for the optional use of
           ;; `variable-pitch' typography, a height value as a multiple of
           ;; the base font size (e.g. 1.5), and a `WEIGHT'.
           modus-themes-headings
           '((1 . (variable-pitch 1.5))
             (2 . (1.3))
             (agenda-date . (1.3))
             (agenda-structure . (variable-pitch light 1.8))
             (t . (1.1))))

     ;; Remember that more (MUCH MORE) can be done with palette overrides,
     ;; which I document extensively in this manual.

* Menu:

* Disable other themes::         Determine whether loading a Modus themes disables all others
* Bold constructs::              Toggle bold constructs in code
* Italic constructs::            Toggle italic font constructs in code
* Option for which themes to toggle::
* Option for which themes to rotate::
* Mixed fonts::                  Toggle mixing of font families
* Org mode blocks::              Choose among plain, gray, or tinted backgrounds
* Heading styles::               Choose among several styles, also per heading level
* UI typeface::                  Toggle the use of variable-pitch across the User Interface
* Palette overrides::            Refashion color values and/or semantic color mappings
* Palette extension::            Define new colors and use them like the original ones


File: modus-themes.info,  Node: Disable other themes,  Next: Bold constructs,  Up: Customization options

5.1 Option to disable other color themes when loading a Modus theme
===================================================================

The user option ‘modus-themes-disable-other-themes’ makes Modus commands
that load a theme automatically disable all other color themes (*note
Enable and load::).  This is to ensure that Emacs does not blend two or
more color themes, which it will otherwise do.  Blending different color
themes seldom leads to good results.

   This user option is enabled by default.  Set it to ‘nil’ if you want
to load and subsequently blend color themes.


File: modus-themes.info,  Node: Bold constructs,  Next: Italic constructs,  Prev: Disable other themes,  Up: Customization options

5.2 Option for more bold constructs
===================================

The user option ‘modus-themes-bold-constructs’ controls whether several
elements across different interfaces use a decorative bold weight.  By
default, when the value of this user option is set to ‘nil’, Modus
themes use bold only where necessary.

   Modus is designed to apply the ‘bold’ face in such cases.  This means
that users can modify that face directly, such as to make its weight
heavier or use a different font family (*note Configure bold and italic
faces: DIY Configure bold and italic faces.).  Once that is done,
everything that Modus renders in a bold weight will exhibit those exact
styles.


File: modus-themes.info,  Node: Italic constructs,  Next: Option for which themes to toggle,  Prev: Bold constructs,  Up: Customization options

5.3 Option for more italic constructs
=====================================

The user option ‘modus-themes-italic-constructs’ controls whether
several elements across different interfaces use a decorative italic
style, which typically is expressed as slanted text.  By default, when
the value of this user option is set to ‘nil’, Modus themes use italic
only where necessary.

   Modus is designed to apply the ‘italic’ face in such cases.  This
means that users can modify that face directly, such as to change its
slant, if that is supported by the underlying font family, or simply a
different font family than the main font (*note Configure italic and
italic faces: DIY Configure bold and italic faces.).  Once that is done,
everything that Modus renders in italics will exhibit those exact
styles.


File: modus-themes.info,  Node: Option for which themes to toggle,  Next: Option for which themes to rotate,  Prev: Italic constructs,  Up: Customization options

5.4 Option for which themes to toggle
=====================================

The user option ‘modus-themes-to-toggle’ controls which themes will the
command ‘modus-themes-toggle’ switch between.  Possible values include
all themes returned by the function ‘modus-themes-get-themes’ (*note
Build on top of the Modus themes::).


File: modus-themes.info,  Node: Option for which themes to rotate,  Next: Mixed fonts,  Prev: Option for which themes to toggle,  Up: Customization options

5.5 Option for which themes to rotate
=====================================

The user option ‘modus-themes-to-rotate’ controls which themes will the
command ‘modus-themes-rotate’ cycle between in rotation from left to
right.  When ‘modus-themes-rotate’ is called with an optional prefix
argument (‘C-u’ by default), it will move from right to left.  Possible
values include all themes returned by the function
‘modus-themes-get-themes’ (*note Build on top of the Modus themes::).


File: modus-themes.info,  Node: Mixed fonts,  Next: Org mode blocks,  Prev: Option for which themes to rotate,  Up: Customization options

5.6 Option for font mixing
==========================

The user option ‘modus-themes-mixed-fonts’ sets up Modus to render
spacing-sensitive elements, such as Org tables and code blocks, in a
monospaced font.  It does so when it is set to a non-‘nil’ value.

   Then, it is possible for users to rely on the built-in ‘M-x
variable-pitch-mode’.  ‘variable-pitch-mode’ sets the current buffer to
a proportionately spaced font, but it will not affect the elements that
Modus renders in an explicitly monospaced way.

   If ‘modus-themes-mixed-fonts’ is set to ‘nil’ (the default), buffers
that have ‘variable-pitch-mode’ enabled may appear broken wherever
spacing-sensitive elements are present.

   For a consistent typographic experience, user may need to specify the
font family of the ‘default’, ‘fixed-pitch’, and ‘variable-pitch’ faces
(*note Font configurations for Org and others: DIY Font configurations
for Org and others.).


File: modus-themes.info,  Node: Org mode blocks,  Next: Heading styles,  Prev: Mixed fonts,  Up: Customization options

5.7 Option for org-mode block styles
====================================

As part of version ‘4.4.0’, the ‘modus-themes-org-blocks’ is no more.
Users can apply palette overrides to set a style that fits their
preference (purple, blue, yellow, green, etc.).  It is more flexible and
more powerful (*note DIY Make Org block colors more or less colorful::)

   For the option to change the background of Org source blocks, I
provide the relevant setup (*note DIY Use colored Org source blocks per
language::).


File: modus-themes.info,  Node: Heading styles,  Next: UI typeface,  Prev: Org mode blocks,  Up: Customization options

5.8 Option for the headings' overall style
==========================================

Brief: Heading styles with optional list of values per heading level.

   Symbol: ‘modus-themes-headings’ (‘alist’ type, multiple properties)

   This is an alist that accepts a ‘(KEY . LIST-OF-VALUES)’ combination.
The ‘KEY’ is either a number, representing the heading's level (0
through 8) or ‘t’, which pertains to the fallback style.  The named keys
‘agenda-date’ and ‘agenda-structure’ apply to the Org agenda.

   Level 0 is a special heading: it is used for what counts as a
document title or equivalent, such as the ‘#+title’ construct I find in
Org files.  Levels 1-8 are regular headings.

   The ‘LIST-OF-VALUES’ covers symbols that refer to properties, as
described below.  Here is a complete sample with various stylistic
combinations, followed by a presentation of all available properties:

     (setq modus-themes-headings
           '((1 . (variable-pitch 1.5))
             (2 . (1.3))
             (agenda-date . (1.3))
             (agenda-structure . (variable-pitch light 1.8))
             (t . (1.1))))

   Properties:

   • A font weight, which must be supported by the underlying typeface:
        • ‘thin’
        • ‘ultralight’
        • ‘extralight’
        • ‘light’
        • ‘semilight’
        • ‘regular’
        • ‘medium’
        • ‘semibold’
        • ‘bold’ (default)
        • ‘heavy’
        • ‘extrabold’
        • ‘ultrabold’
   • A floating point as a height multiple of the default or a cons cell
     in the form of ‘(height . FLOAT)’.

   By default (a ‘nil’ value for this variable), all headings have a
bold typographic weight and use a desaturated text color.

   A ‘variable-pitch’ property changes the font family of the heading to
that of the ‘variable-pitch’ face (normally a proportionately spaced
typeface).

   The symbol of a weight attribute adjusts the font of the heading
accordingly, such as ‘light’, ‘semibold’, etc.  Valid symbols are
defined in the variable ‘modus-themes-weights’.  The absence of a weight
means that bold will be used by virtue of inheriting the ‘bold’ face.

   *note Configure bold and italic faces: DIY Configure bold and italic
faces.

   A number, expressed as a floating point (e.g.  1.5), adjusts the
height of the heading to that many times the base font size.  The
default height is the same as 1.0, though it need not be explicitly
stated.  Instead of a floating point, an acceptable value can be in the
form of a cons cell like ‘(height . FLOAT)’ or ‘(height FLOAT)’, where
FLOAT is the given number.

   Combinations of any of those properties are expressed as a list, like
in these examples:

     (semibold)
     (variable-pitch semibold 1.3)
     (variable-pitch semibold (height 1.3)) ; same as above
     (variable-pitch semibold (height . 1.3)) ; same as above

   The order in which the properties are set is not significant.

   In user configuration files the form may look like this:

     (setq modus-themes-headings
           '((1 . (variable-pitch 1.5))
             (2 . (1.3))
             (agenda-date . (1.3))
             (agenda-structure . (variable-pitch light 1.8))
             (t . (1.1))))

   When defining the styles per heading level, it is possible to pass a
non-‘nil’ value (‘t’) instead of a list of properties.  This will retain
the original aesthetic for that level.  For example:

     (setq modus-themes-headings
           '((1 . t)           ; keep the default style
             (2 . (semibold 1.2))
             (t . (rainbow)))) ; style for all other headings

     (setq modus-themes-headings
           '((1 . (variable-pitch 1.5))
             (2 . (semibold))
             (t . t))) ; default style for all other levels

   Note that the text color of headings, of their background, and
overline can all be set via the overrides.  It is possible to have any
color combination for any heading level (something that could not be
done in older versions of the themes).

   *note Option for palette overrides: Palette overrides.

   *note Make headings more or less colorful: DIY Make headings more or
less colorful.


File: modus-themes.info,  Node: UI typeface,  Next: Palette overrides,  Prev: Heading styles,  Up: Customization options

5.9 Option for variable-pitch font in UI elements
=================================================

Brief: Toggle the use of proportionately spaced (‘variable-pitch’) fonts
in the User Interface.

   Symbol: ‘modus-themes-variable-pitch-ui’ (‘boolean’ type)

   Possible values:

  1. ‘nil’ (default)
  2. ‘t’

   This option concerns User Interface elements that are under the
direct control of Emacs.  In particular: the mode line, header line, tab
bar, and tab line.

   The default is to use the same font as the rest of Emacs, which
usually is a monospaced family.

   With a non-‘nil’ value (‘t’) apply a proportionately spaced typeface.
This is done by assigning the ‘variable-pitch’ face to the relevant
items.

   *note Font configurations for Org and others: DIY Font configurations
for Org and others.


File: modus-themes.info,  Node: Palette overrides,  Next: Palette extension,  Prev: UI typeface,  Up: Customization options

5.10 Option for palette overrides
=================================

This section describes palette overrides in detail.  For a simpler
alternative, use the presets I provide (*note Palette override presets:
DIY Palette override presets.).

   Each Modus theme specifies a color palette that declares named color
values and semantic color mappings:

   • Named colors consist of a symbol and a string that specifies a
     hexadecimal RGB value.  For example: ‘(blue-warmer "#354fcf")’.

   • The semantic color mappings associate an abstract construct with a
     given named color from the palette, like ‘(heading-2
     yellow-faint)’.  Both elements of the list are symbols, though the
     ‘cadr’ (value) can be a string that specifies a color, such as
     ‘(heading-2 "#354fcf")’.

   Both of those subsets can be overridden, thus refashioning the theme.
Overrides are either shared, by being stored in the user option
‘modus-themes-common-palette-overrides’, or they are specific to the
theme they name.  In the latter case, the naming scheme of each palette
variable is ‘THEME-NAME-palette-overrides’, thus yielding:

   • ‘modus-operandi-palette-overrides’

   • ‘modus-operandi-deuteranopia-palette-overrides’

   • ‘modus-operandi-tinted-palette-overrides’

   • ‘modus-operandi-tritanopia-palette-overrides’

   • ‘modus-vivendi-palette-overrides’

   • ‘modus-vivendi-deuteranopia-palette-overrides’

   • ‘modus-vivendi-tinted-palette-overrides’

   • ‘modus-vivendi-tritanopia-palette-overrides’

   Theme-specific overrides take precedence over the shared ones.  It is
strongly advised that shared overrides do NOT alter color values, as
those will not be appropriate for both dark and light themes.  Common
overrides are best limited to the semantic color mappings as those use
the color value that corresponds to the active theme (e.g.  make the
cursor ‘blue-warmer’ in all themes, whatever the value of ‘blue-warmer’
is in each theme).

   The value of any overrides' variable must mirror a theme's palette.
Palette variables are named after their theme as ‘THEME-NAME-palette’.
For example, the ‘modus-operandi-palette’ is like this:

     (defconst modus-operandi-palette
         '(
     ;;; Basic values

           (bg-main     "#ffffff")
           (bg-dim      "#f0f0f0")
           (fg-main     "#000000")

           ;; ...

           (red         "#a60000")
           (red-warmer  "#972500")
           (red-cooler  "#a0132f")
           (red-faint   "#7f0000")
           (red-intense "#d00000")

           ;; ...

     ;;;; Mappings

           ;; ...

           (cursor fg-main)
           (builtin magenta-warmer)
           (comment fg-dim)
           (constant blue-cooler)
           (docstring green-faint)
           (fnname magenta)
           (keyword magenta-cooler)

           ;; ...
           ))

   The ‘modus-operandi-palette-overrides’ targets the entries that need
to be changed.  For example, to make the main foreground color a dark
gray instead of pure black, use a shade of red for comments, and apply a
cyan hue to keywords:

     (setq modus-operandi-palette-overrides
           '((fg-main "#333333")
             (comment red-faint)
             (keyword cyan-cooler)))

   Changes take effect upon theme reload.  Overrides are removed by
setting their variable to a ‘nil’ value.

   The common accented foregrounds in each palette follow a predictable
naming scheme: ‘HUE{,-warmer,-cooler,-faint,-intense}’.  ‘HUE’ is one of
the six basic colors: red, green, blue, yellow, magenta, cyan.

   Named colors that are meant to be used as backgrounds contain ‘bg’ in
their name, such as ‘bg-red-intense’.  While special purpose foregrounds
that are meant to be combined with such backgrounds, contain ‘fg’ in
their name, such as ‘fg-removed’ which complements ‘bg-removed’.

   Named colors can be previewed, such as with the command
‘modus-themes-list-colors’ (*note Preview theme colors::).

   For a video tutorial that users of all skill levels can approach,
watch:
<https://protesilaos.com/codelog/2022-12-17-modus-themes-v4-demo/>.


File: modus-themes.info,  Node: Palette extension,  Prev: Palette overrides,  Up: Customization options

5.11 Option to extend the palette
=================================

It is possible to extend the palette of each theme.  For example, the
user may define their own ‘cherry’ color with a value of ‘#a0134f’ and
then apply it as an override (*note Option for palette overrides:
Palette overrides.).  Those colors may also be used in custom code that
leverages either the ‘modus-themes-with-colors’ macro or the function
‘modus-themes-get-color-value’.

   The palette extension can be done in the form of a common set of
definitions that are shared among the themes or on a per-theme basis.

   The common values are stored in the user option
‘modus-themes-common-palette-user’.  As for per-theme variables, I have
the following user options:

   • ‘modus-operandi-palette-user’

   • ‘modus-operandi-tinted-palette-user’

   • ‘modus-operandi-deuteranopia-palette-user’

   • ‘modus-operandi-tritanopia-palette-user’

   • ‘modus-vivendi-palette-user’

   • ‘modus-vivendi-tinted-palette-user’

   • ‘modus-vivendi-deuteranopia-palette-user’

   • ‘modus-vivendi-tritanopia-palette-user’

   Examples demonstrating how to use the aforementioned:

     ;;; Common customizations

     ;; Define two new colors in the common "user" palette of all the Modus themes.
     (setq modus-themes-common-palette-user
           '((cherry "#a0134f")
             (plum "#6f459a")))

     ;; Use them in the overrides.
     (setq modus-themes-common-palette-overrides
           '((cursor cherry)
             (string plum)))

     ;;; Per-theme customizations

     ;; Define two new colors in the "user" palette of `modus-operandi'.
     ;; Other themes will not use these.
     (setq modus-operandi-palette-user
           '((cherry "#a0134f")
             (plum "#6f459a")))

     ;; Use them in the overrides.
     (setq modus-operandi-palette-overrides
           '((cursor cherry)
             (string plum)))


     ;; Tweaks on a per-theme basis give the user maximum flexibility. For
     ;; example, they can have the above for `modus-operandi' while they use
     ;; these for `modus-vivendi':
     (setq modus-vivendi-palette-user
           '((apricot "#dfb350")
             (kiwi "#80d458")))

     (setq modus-vivendi-palette-overrides
           '((cursor apricot)
             (string kiwi)))


File: modus-themes.info,  Node: Preview theme colors,  Next: Use colors from the Modus themes palette,  Prev: Customization options,  Up: Top

6 Preview theme colors
**********************

The command ‘modus-themes-list-colors’ uses minibuffer completion to
select an item from the Modus themes and then produces a buffer with
previews of all of its color palette entries (*note Commands for the
preview palette buffer::).

   The command ‘modus-themes-list-colors-current’ skips the minibuffer
selection process to produce a preview for the current Modus theme.

   When called with a prefix argument ‘C-u’ with the default key
bindings), these commands will show a preview of the palette's semantic
color mappings instead of the full palette (*note Option for palette
overrides: Palette overrides.).

   Aliases for those commands are ‘modus-themes-preview-colors’ and
‘modus-themes-preview-colors-current’.

   Each row includes a foreground and background rendition of the given
color value.  For example a line with ‘#a60000’ (a shade of red) will
show a column with a red background combined with a suitable foreground
followed by another column with a red foreground against the current
theme's background.  The intent is to illustrate which values are
suitable as a background or foreground.

   The name of the buffer describes the given Modus theme and what the
contents are, such as ‘*modus-operandi-list-all*’ for the entirety of
the palette (named colors as well as semantic color mappings) and
‘=*modus-operandi-list-mappings*’ for the mappings only.

* Menu:

* Commands for the preview palette buffer::


File: modus-themes.info,  Node: Commands for the preview palette buffer,  Up: Preview theme colors

6.1 Commands for the preview palette buffer
===========================================

The palette preview buffer uses the major mode
‘modus-themes-preview-mode’, which provides the
‘modus-themes-preview-mode-map’ (*note Preview theme colors::).  The
following key bindings are available by default:

Default key binding   Name of the command
---------------------------------------------------------------
‘w’                   ‘modus-themes-preview-mode-copy-color’
‘W’                   ‘modus-themes-preview-mode-copy-entry’
‘m’                   ‘modus-themes-preview-mode-mark’
‘M’                   ‘modus-themes-preview-mode-mark-all’
‘u’                   ‘modus-themes-preview-mode-unmark’
‘U’                   ‘modus-themes-preview-mode-unmark-all’

   The command ‘modus-themes-preview-mode-copy-color’ copies the
resolved color value of the entry at point or of all the marked entries.
This means that it always returns a string with the value of the color,
not a symbolic representation of it.  For example, if ‘cursor’ is mapped
to ‘red-warmer’, this command will return ‘"#972500"’ while previewing
the palette of the ‘modus-operandi’ theme.

   The command ‘modus-themes-preview-mode-copy-entry’ copies the palette
entry as such.  This is how the entry is in the underlying palette
definition.  For example, it will return ‘(magenta-cooler "#531ab6")’ or
‘(keybind blue-warmer)’.  Copying those is useful as a starting point
for writing palette overrides (*note Option for palette overrides:
Palette overrides.).

   The commands ‘modus-themes-preview-mode-mark’,
‘modus-themes-preview-mode-mark-all’,
‘modus-themes-preview-mode-unmark’, and
‘modus-themes-preview-mode-unmark-all’, will add or remove a marker from
the current or affected lines.  These marks influence the result of the
aforementioned commands for copying colors and palette entries.


File: modus-themes.info,  Node: Use colors from the Modus themes palette,  Next: Advanced customization,  Prev: Preview theme colors,  Up: Top

7 Use colors from the Modus themes palette
******************************************

The Modus themes provide the means to access the palette of (i) the
active theme or (ii) any theme in the Modus collection.  These are
useful for Do-It-Yourself customizations (*note Advanced
customization::), though it can also be helpful in other cases, such as
to reuse a color value in some other application.

Function
     *note Get a single color from the palette with
     modus-themes-get-color-value::
Macro
     *note Use theme colors in code with modus-themes-with-colors::.

* Menu:

* Get a single color from the palette with modus-themes-get-color-value::
* Use theme colors in code with modus-themes-with-colors::


File: modus-themes.info,  Node: Get a single color from the palette with modus-themes-get-color-value,  Next: Use theme colors in code with modus-themes-with-colors,  Up: Use colors from the Modus themes palette

7.1 Get a single color from the palette with ‘modus-themes-get-color-value’
===========================================================================

The function ‘modus-themes-get-color-value’ can be called from Lisp to
return the value of a color from the active Modus theme palette.  It
takea a ‘COLOR’ argument and an optional ‘OVERRIDES’.  It also accepts a
third ‘THEME’ argument, to get the color from the given theme.

   ‘COLOR’ is a symbol that represents a named color entry in the
palette (*note Preview theme colors::).

   If the value is the name of another color entry in the palette (so a
mapping), this function recurs until it finds the underlying color
value.

   With an optional ‘OVERRIDES’ argument as a non-‘nil’ value, it
accounts for palette overrides.  Else it reads only the default palette
(*note Option for palette overrides: Palette overrides.)

   With an optional ‘THEME’ as a symbol among the ‘modus-themes-items’
(alias ‘modus-themes-collection’), it uses the palette of that theme.
Else it uses the current Modus theme.

   If ‘COLOR’ is not present in the palette, this function returns the
‘unspecified’ symbol, which is safe when used as a face attribute's
value.

   An example with ‘modus-operandi’ to show how this function behaves
with/without overrides and when recursive mappings are introduced.

     ;; Here I show the recursion of palette mappings.  In general, it is
     ;; better for the user to specify named colors to avoid possible
     ;; confusion with their configuration, though those still work as
     ;; expected.
     (setq modus-themes-common-palette-overrides
           '((cursor red)
             (fg-mode-line-active cursor)
             (border-mode-line-active fg-mode-line-active)))

     ;; Ignore the overrides and get the original value.
     (modus-themes-get-color-value 'border-mode-line-active)
     ;; => "#5a5a5a"

     ;; Read from the overrides and deal with any recursion to find the
     ;; underlying value.
     (modus-themes-get-color-value 'border-mode-line-active :overrides)
     ;; => "#a60000"


File: modus-themes.info,  Node: Use theme colors in code with modus-themes-with-colors,  Prev: Get a single color from the palette with modus-themes-get-color-value,  Up: Use colors from the Modus themes palette

7.2 Use theme colors in code with ‘modus-themes-with-colors’
============================================================

[ Note that for common cases the following is not not needed.  Just rely
on the comprehensive overrides I provide (*note Option for palette
overrides: Palette overrides.).  ]

   Advanced users may want to apply many colors from the palette of the
active Modus theme in their custom code.  In such a case, retrieving
each value with the function ‘modus-themes-get-color-value’ is
inefficient (*note Get a single color from the palette: Get a single
color from the palette with modus-themes-get-color-value.).  The Lisp
macro ‘modus-themes-with-colors’ provides the requisite functionality.
It supplies the current theme's palette to the code called from inside
of it.  For example:

     (modus-themes-with-colors
       (list blue-warmer magenta-cooler fg-added warning variable fg-heading-4))
     ;; => ("#354fcf" "#531ab6" "#005000" "#884900" "#005e8b" "#721045")

   The above return value is for ‘modus-operandi’ when that is the
active theme.  Switching to another theme and evaluating this code anew
will return the relevant results for that theme (remember that since
version 4, the Modus themes consist of many items (*note Overview::)).
The same with ‘modus-vivendi’ as the active theme:

     (modus-themes-with-colors
       (list blue-warmer magenta-cooler fg-added warning variable fg-heading-4))
     ;; => ("#79a8ff" "#b6a0ff" "#a0e0a0" "#fec43f" "#00d3d0" "#feacd0")

   The ‘modus-themes-with-colors’ has access to the whole palette of the
active theme, meaning that it can instantiate both (i) named colors like
‘blue-warmer’ and (ii) semantic color mappings like ‘warning’.  I
provide commands to inspect those (*note Preview theme colors::).

   Others sections in this manual show how to use the aforementioned
macro (*note Advanced customization::).  In practice, the use of a hook
will also be needed (*note DIY Use a hook at the post-load-theme
phase::).


File: modus-themes.info,  Node: Advanced customization,  Next: Build on top of the Modus themes,  Prev: Use colors from the Modus themes palette,  Up: Top

8 Advanced customization
************************

Unlike the predefined customization options which follow a clear pattern
of allowing the user to quickly specify their preference, the themes
also provide a more flexible, albeit a bit more difficult, mechanism to
control things with precision (*note Customization Options:
Customization options.).

   This section is of interest only to users who are prepared to
maintain their own local tweaks and who are willing to deal with any
possible incompatibilities between versioned releases of the themes.  As
such, they are labeled as "do-it-yourself" or "DIY".

* Menu:

* DIY Palette override presets::
* DIY Add support for vc-annotate::
* DIY Add support for engrave-faces::
* DIY Stylistic variants using palette overrides::
* DIY More accurate colors in terminal emulators::
* DIY Range of color with terminal emulators::
* DIY Per-theme customization settings::
* DIY Do not extend the region background::
* DIY Add padding to the mode line::
* DIY Remap face with local value::
* DIY Font configurations for Org and others::
* DIY Configure bold and italic faces::
* DIY Custom Org todo keyword and priority faces::
* DIY Custom Org emphasis faces::
* DIY Use colored Org source blocks per language::
* DIY Measure color contrast::
* DIY Load theme depending on time of day::
* DIY Backdrop for pdf-tools::
* DIY Toggle themes without reloading them::
* DIY Use more spacious margins or padding in Emacs frames::
* DIY Custom hl-todo colors::
* DIY Add support for solaire-mode::
* DIY Add support for meow-mode::
* DIY Add support for combobulate::
* DIY Use a hook at the post-load-theme phase::


File: modus-themes.info,  Node: DIY Palette override presets,  Next: DIY Add support for vc-annotate,  Up: Advanced customization

8.1 DIY Palette override presets
================================

This section shows how to refashion the themes by opting in to the
stylistic presets I provide.  Those presets override the default color
mappings to amplify, tone down, or refashion the overall coloration of
the themes.

   To make almost all aspects of the themes less intense, use this:

     ;; Always remember to reload the theme for changes to take effect!
     (setq modus-themes-common-palette-overrides modus-themes-preset-overrides-faint)

   With ‘modus-themes-preset-overrides-faint’ the grays are toned down,
gray backgrounds are removed from some contexts, and almost all accent
colors are desaturated.  It makes the themes less attention-grabbing.

   On the opposite end of the stylistic spectrum, I have this

     ;; Always remember to reload the theme for changes to take effect!
     (setq modus-themes-common-palette-overrides modus-themes-preset-overrides-intense)

   The ‘modus-themes-preset-overrides-intense’ makes many background
colors accented instead of gray and increases coloration in a number of
places.  Colors stand out more and are made easier to spot.

   For some stylistic variation try the "cooler" and "warmer" presets:

     ;; This:
     (setq modus-themes-common-palette-overrides modus-themes-preset-overrides-cooler)

     ;; Or:
     (setq modus-themes-common-palette-overrides modus-themes-preset-overrides-warmer)

   Note that the user is not limited to those presets.  The system of
overrides I provide makes it possible to tweak the value of each
individual named color and to change how values are assigned to semantic
color mappings (*note Option for palette overrides: Palette overrides.).
Subsequent sections provide examples (*note Stylistic variants using
palette overrides: DIY Stylistic variants using palette overrides.).

   It is also possible to use those presets as a basis and, for example,
add to them code from the subsequent sections of this manual.  This is
the general idea (extra space for didactic purposes):

     (setq modus-themes-common-palette-overrides
           `(
             ;; From the section "Make the mode line borderless"
             (border-mode-line-active unspecified)
             (border-mode-line-inactive unspecified)

             ;; From the section "Make matching parenthesis more or less intense"
             (bg-paren-match bg-magenta-intense)
             (underline-paren-match fg-main)

             ;; And expand the preset here.  Note that the ,@ works because
             ;; I use the backtick for this list, instead of a straight
             ;; quote.
             ,@modus-themes-preset-overrides-intense))


File: modus-themes.info,  Node: DIY Add support for vc-annotate,  Next: DIY Add support for engrave-faces,  Prev: DIY Palette override presets,  Up: Advanced customization

8.2 DIY Add support for ‘vc-annotate’
=====================================

The built-in ‘vc-annotate’ command relies on a user option to read color
values.  Users thus need to write their own configuration like this
(*note DIY Use a hook at the post-load-theme phase::):

     (defun my-modus-vc-annotate (&rest _)
       (modus-themes-with-colors
         (setq vc-annotate-background-mode nil)
         (setq vc-annotate-very-old-color fg-dim)
         (setq vc-annotate-color-map
               `(( 20. . ,red)
                 ( 40. . ,red-cooler)
                 ( 60. . ,red-warmer)
                 ( 80. . ,yellow-warmer)
                 (100. . ,yellow)
                 (120. . ,yellow-cooler)
                 (140. . ,green-warmer)
                 (160. . ,green)
                 (180. . ,green-cooler)
                 (200. . ,cyan-cooler)
                 (220. . ,cyan-warmer)
                 (240. . ,cyan)
                 (260. . ,blue-warmer)
                 (280. . ,blue)
                 (300. . ,blue-cooler)
                 (320. . ,blue-intense)
                 (340. . ,magenta-cooler)
                 (360. . ,fg-dim)))))

     (with-eval-after-load 'vc-annotate
       (my-modus-vc-annotate)
       (add-hook 'enable-theme-functions #'my-modus-vc-annotate))


File: modus-themes.info,  Node: DIY Add support for engrave-faces,  Next: DIY Stylistic variants using palette overrides,  Prev: DIY Add support for vc-annotate,  Up: Advanced customization

8.3 DIY Add support for ‘engrave-faces’
=======================================

The ‘engraved-faces’ package is used as part of an Org export process to
produce decent colors in the output.  Its default style though requires
changes to use the colors of the active Modus theme.

   In the code below I show how to map everything that ‘engrave-faces’
defines to the corresponding entry in the palette of the active Modus
theme.  I then use a hook to ensure that the value is updated after I
switch to another theme in the collection (*note DIY Use a hook at the
post-load-theme phase::).

     (defun my-modus-themes-engraved-faces (&rest _)
       (modus-themes-with-colors
         (setq engrave-faces-themes
               `((default .
                          (;; faces.el --- excluding: bold, italic, bold-italic, underline, and some others
                           (default                             :short "default"             :slug "D"   :foreground ,fg-main :background ,bg-main :family "Monospace")
                           (variable-pitch                      :short "var-pitch"           :slug "vp"  :foreground ,fg-main                       :family "Sans Serif")
                           (shadow                              :short "shadow"              :slug "h"   :foreground ,fg-dim)
                           (success                             :short "success"             :slug "sc"  :foreground ,green :weight bold)
                           (warning                             :short "warning"             :slug "w"   :foreground ,warning :weight bold)
                           (error                               :short "error"               :slug "e"   :foreground ,err :weight bold)
                           (link                                :short "link"                :slug "l"   :foreground ,fg-link)
                           (link-visited                        :short "link"                :slug "lv"  :foreground ,fg-link-visited)
                           (highlight                           :short "link"                :slug "hi"  :foreground ,info)
                           ;; font-lock.el
                           (font-lock-comment-face              :short "fl-comment"          :slug "c"   :foreground ,comment)
                           (font-lock-comment-delimiter-face    :short "fl-comment-delim"    :slug "cd"  :foreground ,comment)
                           (font-lock-string-face               :short "fl-string"           :slug "s"   :foreground ,string)
                           (font-lock-doc-face                  :short "fl-doc"              :slug "d"   :foreground ,docstring)
                           (font-lock-doc-markup-face           :short "fl-doc-markup"       :slug "m"   :foreground ,docmarkup)
                           (font-lock-keyword-face              :short "fl-keyword"          :slug "k"   :foreground ,keyword)
                           (font-lock-builtin-face              :short "fl-builtin"          :slug "b"   :foreground ,builtin)
                           (font-lock-function-name-face        :short "fl-function"         :slug "f"   :foreground ,fnname)
                           (font-lock-variable-name-face        :short "fl-variable"         :slug "v"   :foreground ,variable)
                           (font-lock-type-face                 :short "fl-type"             :slug "t"   :foreground ,type)
                           (font-lock-constant-face             :short "fl-constant"         :slug "o"   :foreground ,constant)
                           (font-lock-warning-face              :short "fl-warning"          :slug "wr"  :foreground ,warning :weight bold)
                           (font-lock-negation-char-face        :short "fl-neg-char"         :slug "nc")
                           (font-lock-preprocessor-face         :short "fl-preprocessor"     :slug "pp"  :foreground ,preprocessor)
                           (font-lock-regexp-grouping-construct :short "fl-regexp"           :slug "rc"                        :weight bold)
                           (font-lock-regexp-grouping-backslash :short "fl-regexp-backslash" :slug "rb"                        :weight bold)
                           ;; org-faces.el
                           (org-block                           :short "org-block"           :slug "ob") ; forcing no background is preferable
                           (org-block-begin-line                :short "org-block-begin"     :slug "obb") ; forcing no background is preferable
                           (org-block-end-line                  :short "org-block-end"       :slug "obe") ; forcing no background is preferable
                           ;; outlines
                           (outline-1                           :short "outline-1"           :slug "Oa"  :foreground ,fg-heading-1)
                           (outline-2                           :short "outline-2"           :slug "Ob"  :foreground ,fg-heading-2)
                           (outline-3                           :short "outline-3"           :slug "Oc"  :foreground ,fg-heading-3)
                           (outline-4                           :short "outline-4"           :slug "Od"  :foreground ,fg-heading-4)
                           (outline-5                           :short "outline-5"           :slug "Oe"  :foreground ,fg-heading-5)
                           (outline-6                           :short "outline-6"           :slug "Of"  :foreground ,fg-heading-6)
                           (outline-7                           :short "outline-7"           :slug "Og"  :foreground ,fg-heading-7)
                           (outline-8                           :short "outline-8"           :slug "Oh"  :foreground ,fg-heading-8)
                           ;; highlight-numbers.el
                           (highlight-numbers-number            :short "hl-number"           :slug "hn"  :foreground ,number)
                           ;; highlight-quoted.el
                           (highlight-quoted-quote              :short "hl-qquote"           :slug "hq"  :foreground ,string)
                           (highlight-quoted-symbol             :short "hl-qsymbol"          :slug "hs"  :foreground ,constant)
                           ;; rainbow-delimiters.el
                           (rainbow-delimiters-depth-1-face     :short "rd-1"                :slug "rda" :foreground ,rainbow-0)
                           (rainbow-delimiters-depth-2-face     :short "rd-2"                :slug "rdb" :foreground ,rainbow-1)
                           (rainbow-delimiters-depth-3-face     :short "rd-3"                :slug "rdc" :foreground ,rainbow-2)
                           (rainbow-delimiters-depth-4-face     :short "rd-4"                :slug "rdd" :foreground ,rainbow-3)
                           (rainbow-delimiters-depth-5-face     :short "rd-5"                :slug "rde" :foreground ,rainbow-4)
                           (rainbow-delimiters-depth-6-face     :short "rd-6"                :slug "rdf" :foreground ,rainbow-5)
                           (rainbow-delimiters-depth-7-face     :short "rd-7"                :slug "rdg" :foreground ,rainbow-6)
                           (rainbow-delimiters-depth-8-face     :short "rd-8"                :slug "rdh" :foreground ,rainbow-7)
                           (rainbow-delimiters-depth-9-face     :short "rd-9"                :slug "rdi" :foreground ,rainbow-8)
                           ;; ansi-color
                           (ansi-color-yellow                   :short "ansi-yellow"         :slug "any" :foreground ,fg-term-yellow)
                           (ansi-color-red                      :short "ansi-red"            :slug "anr" :foreground ,fg-term-red)
                           (ansi-color-black                    :short "ansi-black"          :slug "anb" :foreground ,fg-term-black)
                           (ansi-color-green                    :short "ansi-green"          :slug "ang" :foreground ,fg-term-green)
                           (ansi-color-blue                     :short "ansi-blue"           :slug "anB" :foreground ,fg-term-blue)
                           (ansi-color-cyan                     :short "ansi-cyan"           :slug "anc" :foreground ,fg-term-cyan)
                           (ansi-color-white                    :short "ansi-white"          :slug "anw" :foreground ,fg-term-white)
                           (ansi-color-magenta                  :short "ansi-magenta"        :slug "anm" :foreground ,fg-term-magenta)
                           (ansi-color-bright-yellow            :short "ansi-bright-yellow"  :slug "ANy" :foreground ,fg-term-yellow-bright)
                           (ansi-color-bright-red               :short "ansi-bright-red"     :slug "ANr" :foreground ,fg-term-red-bright)
                           (ansi-color-bright-black             :short "ansi-bright-black"   :slug "ANb" :foregroun  ,fg-term-black-bright)
                           (ansi-color-bright-green             :short "ansi-bright-green"   :slug "ANg" :foreground ,fg-term-green-bright)
                           (ansi-color-bright-blue              :short "ansi-bright-blue"    :slug "ANB" :foreground ,fg-term-blue-bright)
                           (ansi-color-bright-cyan              :short "ansi-bright-cyan"    :slug "ANc" :foreground ,fg-term-cyan-bright)
                           (ansi-color-bright-white             :short "ansi-bright-white"   :slug "ANw" :foregroun  ,fg-term-white-bright)
                           (ansi-color-bright-magenta           :short "ansi-bright-magenta" :slug "ANm" :foregroun  ,fg-term-magenta-bright)))))))

     (add-hook 'enable-theme-functions #'my-modus-themes-engraved-faces)


File: modus-themes.info,  Node: DIY Stylistic variants using palette overrides,  Next: DIY More accurate colors in terminal emulators,  Prev: DIY Add support for engrave-faces,  Up: Advanced customization

8.4 DIY Stylistic variants using palette overrides
==================================================

This section contains practical examples of overriding the palette of
the themes (*note Option for palette overrides: Palette overrides.).
Users can copy the code to their init file, evaluate it, and then
re-load the theme for changes to take effect.  To apply overrides at
startup simply define them before the call that loads the theme.
Remember that I also provide presets that are easier to apply (*note
Palette override presets: DIY Palette override presets.).

* Menu:

* DIY Make the mode line borderless::
* DIY Make the active mode line colorful::
* DIY Make the tab bar more or less colorful::
* DIY Make the fringe invisible or another color::
* DIY Make links use subtle or no underlines::
* DIY Make prompts more or less colorful::
* DIY Make completion matches more or less colorful::
* DIY Make comments yellow and strings green::
* DIY Make code syntax use the old alt-syntax style::
* DIY Make use of alternative styles for code syntax::
* DIY Make matching parenthesis more or less intense::
* DIY Make box buttons more or less gray::
* DIY Make TODO and DONE more or less intense::
* DIY Make headings more or less colorful::
* DIY Make Org block colors more or less colorful::
* DIY Make Org agenda more or less colorful::
* DIY Make inline code in prose use alternative styles::
* DIY Make mail citations and headers more or less colorful::
* DIY Make the region preserve text colors, plus other styles: DIY Make the region preserve text colors plus other styles.
* DIY Make mouse highlights more or less colorful::
* DIY Make language underlines less colorful::
* DIY Make line numbers use alternative styles::
* DIY Make diffs use only a foreground::
* DIY Make deuteranopia diffs red and blue instead of yellow and blue::


File: modus-themes.info,  Node: DIY Make the mode line borderless,  Next: DIY Make the active mode line colorful,  Up: DIY Stylistic variants using palette overrides

8.4.1 DIY Make the mode line borderless
---------------------------------------

This is one of my practical examples to override the semantic colors of
the Modus themes (*note Stylistic variants using palette overrides: DIY
Stylistic variants using palette overrides.).  To hide the border around
the active and inactive mode lines, I need to set their color to that of
the underlying background.

   *note Make the active mode line colorful: DIY Make the active mode
line colorful.

   *note Add padding to mode line: DIY Add padding to the mode line.

     ;; Remove the border
     (setq modus-themes-common-palette-overrides
           '((border-mode-line-active unspecified)
             (border-mode-line-inactive unspecified)))

     ;; Keep the border but make it the same color as the background of the
     ;; mode line (thus appearing borderless).  The difference with the
     ;; above is that this version is a bit thicker because the border are
     ;; still there.
     (setq modus-themes-common-palette-overrides
           '((border-mode-line-active bg-mode-line-active)
             (border-mode-line-inactive bg-mode-line-inactive)))

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Make the active mode line colorful,  Next: DIY Make the tab bar more or less colorful,  Prev: DIY Make the mode line borderless,  Up: DIY Stylistic variants using palette overrides

8.4.2 DIY Make the active mode line colorful
--------------------------------------------

This is one of my practical examples to override the semantic colors of
the Modus themes (*note Stylistic variants using palette overrides: DIY
Stylistic variants using palette overrides.).  Here I show some snippets
that apply different stylistic variants.  Of course, it is possible to
use theme-specific overrides to, say, have a blue mode line for
‘modus-operandi’ and a red one for ‘modus-vivendi’.

   *note Make the mode line borderless: DIY Make the mode line
borderless.

   *note Add padding to mode line: DIY Add padding to the mode line.

     ;; Blue background, neutral foreground, intense blue border
     (setq modus-themes-common-palette-overrides
           '((bg-mode-line-active bg-blue-intense)
             (fg-mode-line-active fg-main)
             (border-mode-line-active blue-intense)))

     ;; Subtle blue background, neutral foreground, intense blue border
     (setq modus-themes-common-palette-overrides
           '((bg-mode-line-active bg-blue-subtle)
             (fg-mode-line-active fg-main)
             (border-mode-line-active blue-intense)))

     ;; Sage (green/cyan) background, neutral foreground, slightly distinct green border
     (setq modus-themes-common-palette-overrides
           '((bg-mode-line-active bg-sage)
             (fg-mode-line-active fg-main)
             (border-mode-line-active bg-green-intense)))

     ;; As above, but with a purple style
     (setq modus-themes-common-palette-overrides
           '((bg-mode-line-active bg-lavender)
             (fg-mode-line-active fg-main)
             (border-mode-line-active bg-magenta-intense)))

     ;; As above, but with an earthly style
     (setq modus-themes-common-palette-overrides
           '((bg-mode-line-active bg-ochre)
             (fg-mode-line-active fg-main)
             (border-mode-line-active bg-yellow-intense)))

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Make the tab bar more or less colorful,  Next: DIY Make the fringe invisible or another color,  Prev: DIY Make the active mode line colorful,  Up: DIY Stylistic variants using palette overrides

8.4.3 DIY Make the tab bar more or less colorful
------------------------------------------------

This is one of my practical examples to override the semantic colors of
the Modus themes (*note Stylistic variants using palette overrides: DIY
Stylistic variants using palette overrides.).  Here I show how to affect
the colors of the built-in ‘tab-bar-mode’ and ‘tab-line-mode’.

   For consistent theme-wide results, consider changing the mode line,
fringes, and line numbers.  These are shown in other sections of this
manual.

     ;; Make the `tab-bar-mode' mode subtle while keepings its original
     ;; gray aesthetic.
     (setq modus-themes-common-palette-overrides
           '((bg-tab-bar bg-main)
             (bg-tab-current bg-active)
             (bg-tab-other bg-dim)))

     ;; Like the above, but the current tab has a colorful background and
     ;; the inactive tabs have a slightly more noticeable gray background.
     (setq modus-themes-common-palette-overrides
           '((bg-tab-bar bg-main)
             (bg-tab-current bg-cyan-intense)
             (bg-tab-other bg-inactive)))

     ;; Make the tabs colorful, using a monochromatic pattern (e.g. shades
     ;; of cyan).
     (setq modus-themes-common-palette-overrides
           '((bg-tab-bar bg-cyan-nuanced)
             (bg-tab-current bg-cyan-intense)
             (bg-tab-other bg-cyan-subtle)))

     ;; Like the above, but with a dichromatic pattern (cyan and magenta).
     (setq modus-themes-common-palette-overrides
           '((bg-tab-bar bg-cyan-nuanced)
             (bg-tab-current bg-magenta-intense)
             (bg-tab-other bg-cyan-subtle)))

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Make the fringe invisible or another color,  Next: DIY Make links use subtle or no underlines,  Prev: DIY Make the tab bar more or less colorful,  Up: DIY Stylistic variants using palette overrides

8.4.4 DIY Make the fringe invisible or another color
----------------------------------------------------

This is one of my practical examples to override the semantic colors of
the Modus themes (*note Stylistic variants using palette overrides: DIY
Stylistic variants using palette overrides.).  Here I show how to make
the fringe invisible or how to assign to it a different color.  The
"fringe" is a small area to the right and left side of the Emacs window
which shows indicators such as for truncation or continuation lines.

     ;; Make the fringe invisible
     (setq modus-themes-common-palette-overrides
           '((fringe unspecified)))

     ;; Make the fringe more intense
     (setq modus-themes-common-palette-overrides
           '((fringe bg-active)))

     ;; Make the fringe colorful, but nuanced
     (setq modus-themes-common-palette-overrides
           '((fringe bg-blue-nuanced)))

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Make links use subtle or no underlines,  Next: DIY Make prompts more or less colorful,  Prev: DIY Make the fringe invisible or another color,  Up: DIY Stylistic variants using palette overrides

8.4.5 DIY Make links use subtle or no underlines
------------------------------------------------

This is one of my practical examples to override the semantic colors of
the Modus themes (*note Stylistic variants using palette overrides: DIY
Stylistic variants using palette overrides.).  In this example, I
showcase the special use of the ‘unspecified’ symbol that underline
mappings can read correctly.

     ;; Subtle underlines
     (setq modus-themes-common-palette-overrides
           '((underline-link border)
             (underline-link-visited border)
             (underline-link-symbolic border)))

     ;; No underlines
     (setq modus-themes-common-palette-overrides
           '((underline-link unspecified)
             (underline-link-visited unspecified)
             (underline-link-symbolic unspecified)))

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Make prompts more or less colorful,  Next: DIY Make completion matches more or less colorful,  Prev: DIY Make links use subtle or no underlines,  Up: DIY Stylistic variants using palette overrides

8.4.6 DIY Make prompts more or less colorful
--------------------------------------------

This section contains practical examples of overriding the palette of
the themes (*note Option for palette overrides: Palette overrides.).  In
the following code block I show how to add or remove color from prompts.

     ;; Keep the background unspecified (like the default), but use a faint
     ;; foreground color.
     (setq modus-themes-common-palette-overrides
           '((fg-prompt cyan-faint)
             (bg-prompt unspecified)))

     ;; Add a nuanced background to prompts that complements their foreground.
     (setq modus-themes-common-palette-overrides
           '((fg-prompt cyan)
             (bg-prompt bg-cyan-nuanced)))

     ;; Add a yellow background and adjust the foreground accordingly.
     (setq modus-themes-common-palette-overrides
           '((fg-prompt fg-main)
             (bg-prompt bg-yellow-subtle))) ; try to replace "subtle" with "intense"

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Make completion matches more or less colorful,  Next: DIY Make comments yellow and strings green,  Prev: DIY Make prompts more or less colorful,  Up: DIY Stylistic variants using palette overrides

8.4.7 DIY Make completion matches more or less colorful
-------------------------------------------------------

This section contains practical examples of overriding the palette of
the themes (*note Option for palette overrides: Palette overrides.).
Here I demonstrate how to activate background coloration for completion
matches.  I show three different degrees of intensity.

     ;; Add a nuanced background color to completion matches, while keeping
     ;; their foreground intact (foregrounds do not need to be specified in
     ;; this case, but I do it for didactic purposes).
     (setq modus-themes-common-palette-overrides
           '((fg-completion-match-0 blue)
             (fg-completion-match-1 magenta-warmer)
             (fg-completion-match-2 cyan)
             (fg-completion-match-3 red)
             (bg-completion-match-0 bg-blue-nuanced)
             (bg-completion-match-1 bg-magenta-nuanced)
             (bg-completion-match-2 bg-cyan-nuanced)
             (bg-completion-match-3 bg-red-nuanced)))

     ;; Add intense background colors to completion matches and adjust the
     ;; foregrounds accordingly.
     (setq modus-themes-common-palette-overrides
           '((fg-completion-match-0 fg-main)
             (fg-completion-match-1 fg-main)
             (fg-completion-match-2 fg-main)
             (fg-completion-match-3 fg-main)
             (bg-completion-match-0 bg-blue-intense)
             (bg-completion-match-1 bg-yellow-intense)
             (bg-completion-match-2 bg-cyan-intense)
             (bg-completion-match-3 bg-red-intense)))

     ;; Like the above, but with subtle backgrounds.
     (setq modus-themes-common-palette-overrides
           '((fg-completion-match-0 fg-main)
             (fg-completion-match-1 fg-main)
             (fg-completion-match-2 fg-main)
             (fg-completion-match-3 fg-main)
             (bg-completion-match-0 bg-blue-subtle)
             (bg-completion-match-1 bg-yellow-subtle)
             (bg-completion-match-2 bg-cyan-subtle)
             (bg-completion-match-3 bg-red-subtle)))

   Adding to the above, it is possible to, say, reduce the number of
colors to two:

     ;; No backgrounds (like the default) and just use two colors.
     (setq modus-themes-common-palette-overrides
           '((fg-completion-match-0 blue)
             (fg-completion-match-1 yellow)
             (fg-completion-match-2 blue)
             (fg-completion-match-3 yellow)
             (bg-completion-match-0 unspecified)
             (bg-completion-match-1 unspecified)
             (bg-completion-match-2 unspecified)
             (bg-completion-match-3 unspecified)))

     ;; Again, a two-color style but this time with backgrounds
     (setq modus-themes-common-palette-overrides
           '((fg-completion-match-0 blue)
             (fg-completion-match-1 yellow)
             (fg-completion-match-2 blue)
             (fg-completion-match-3 yellow)
             (bg-completion-match-0 bg-blue-nuanced)
             (bg-completion-match-1 bg-yellow-nuanced)
             (bg-completion-match-2 bg-blue-nuanced)
             (bg-completion-match-3 bg-yellow-nuanced)))

   The user can mix and match to their liking.

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Make comments yellow and strings green,  Next: DIY Make code syntax use the old alt-syntax style,  Prev: DIY Make completion matches more or less colorful,  Up: DIY Stylistic variants using palette overrides

8.4.8 DIY Make comments yellow and strings green
------------------------------------------------

This is one of my practical examples to override the semantic colors of
the Modus themes (*note Stylistic variants using palette overrides: DIY
Stylistic variants using palette overrides.).  In previous versions of
the themes, I provided an option for yellow-ish comments and green-ish
strings.  For some users, those were still not good enough, as the exact
values were hardcoded.  Here I show how to reproduce the effect, but
also how to tweak it to one's liking.

   *note Make code syntax use the old alt-syntax style: DIY Make code
syntax use the old alt-syntax style.

   *note Make use of alternative styles for code syntax: DIY Make use of
alternative styles for code syntax.

     ;; Yellow comments and green strings like older versions of the Modus
     ;; themes
     (setq modus-themes-common-palette-overrides
           '((comment yellow-cooler)
             (string green-cooler)))

     ;; Faint yellow comments and a different shade of green for strings
     (setq modus-themes-common-palette-overrides
           '((comment yellow-faint)
             (string green-warmer)))

     ;; Green comments and yellow strings, because now the user has the
     ;; freedom to do it
     (setq modus-themes-common-palette-overrides
           '((comment green)
             (string yellow-cooler)))

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Make code syntax use the old alt-syntax style,  Next: DIY Make use of alternative styles for code syntax,  Prev: DIY Make comments yellow and strings green,  Up: DIY Stylistic variants using palette overrides

8.4.9 DIY Make code syntax use the old alt-syntax style
-------------------------------------------------------

This is one of my practical examples to override the semantic colors of
the Modus themes (*note Stylistic variants using palette overrides: DIY
Stylistic variants using palette overrides.).  In this section I show
how to reproduce what previous versions of the Modus themes provided as
a stylistic alternative for code syntax.  The upside of using overrides
for this purpose is that I can tweak the style to my liking, but first
let's start with its recreation:

     ;; The old "alt-syntax" (before version 4.0.0 of the Modus themes)
     (setq modus-themes-common-palette-overrides
           '((builtin magenta)
             (comment fg-dim)
             (constant magenta-cooler)
             (docstring magenta-faint)
             (docmarkup green-faint)
             (fnname magenta-warmer)
             (keyword cyan)
             (preprocessor cyan-cooler)
             (string red-cooler)
             (type magenta-cooler)
             (variable blue-warmer)
             (rx-construct magenta-warmer)
             (rx-backslash blue-cooler)))

   The "alt-syntax" could optionally use green strings and yellow
comments (*note Make comments yellow and strings green: DIY Make
comments yellow and strings green.):

     ;; Same as above, but with yellow comments and green strings
     (setq modus-themes-common-palette-overrides
           '((builtin magenta)
             (comment yellow-faint)
             (constant magenta-cooler)
             (docstring green-faint)
             (docmarkup magenta-faint)
             (fnname magenta-warmer)
             (keyword cyan)
             (preprocessor cyan-cooler)
             (string green-cooler)
             (type magenta-cooler)
             (variable blue-warmer)
             (rx-construct magenta-warmer)
             (rx-backslash blue-cooler)))

   The standard "alt-syntax" has red strings.  As such, it is
interesting to experiment with faintly red colored comments:

     ;; Like the old "alt-syntax" but with faint red comments
     (setq modus-themes-common-palette-overrides
           '((builtin magenta)
             (comment red-faint)
             (constant magenta-cooler)
             (docstring magenta-faint)
             (docmarkup green-faint)
             (fnname magenta-warmer)
             (keyword cyan)
             (preprocessor cyan-cooler)
             (string red-cooler)
             (type magenta-cooler)
             (variable blue-warmer)
             (rx-construct magenta-warmer)
             (rx-backslash blue-cooler)))

   The user can always mix and match styles to their liking.

   *note Make use of alternative styles for code syntax: DIY Make use of
alternative styles for code syntax.

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Make use of alternative styles for code syntax,  Next: DIY Make matching parenthesis more or less intense,  Prev: DIY Make code syntax use the old alt-syntax style,  Up: DIY Stylistic variants using palette overrides

8.4.10 DIY Make use of alternative styles for code syntax
---------------------------------------------------------

This is one of my practical examples to override the semantic colors of
the Modus themes (*note Stylistic variants using palette overrides: DIY
Stylistic variants using palette overrides.).  The idea here is to
change how named colors are mapped to code syntax.  Each of the
following snippets give the ‘modus-themes’ a different feel while
editing code.

   Note that my ‘modus-themes’ and ‘ef-themes’ do not use the same
palettes, so some things are different.  If you copy from the latter to
the former, double-check that the entries exist in the given Modus theme
palette.

   *note Make comments yellow and strings green: DIY Make comments
yellow and strings green.

   *note Make code syntax use the old alt-syntax style: DIY Make code
syntax use the old alt-syntax style.

     ;; Mimic `ef-night' theme (from my `ef-themes') for code syntax
     ;; highlighting, while still using the Modus colors (and other
     ;; mappings).
     (setq modus-themes-common-palette-overrides
           '((builtin green-cooler)
             (comment yellow-faint)
             (constant magenta-cooler)
             (fnname cyan-cooler)
             (keyword blue-warmer)
             (preprocessor red-warmer)
             (docstring cyan-faint)
             (string blue-cooler)
             (type magenta-cooler)
             (variable cyan)))

     ;; Mimic `ef-summer' theme (from my `ef-themes') for code syntax
     ;; highlighting, while still using the Modus colors (and other
     ;; mappings).
     (setq modus-themes-common-palette-overrides
           '((builtin magenta)
             (comment yellow-faint)
             (constant red-cooler)
             (fnname magenta-warmer)
             (keyword magenta-cooler)
             (preprocessor green-warmer)
             (docstring cyan-faint)
             (string yellow-warmer)
             (type cyan-warmer)
             (variable blue-warmer)))

     ;; Mimic `ef-bio' theme (from my `ef-themes') for code syntax
     ;; highlighting, while still using the Modus colors (and other
     ;; mappings).
     (setq modus-themes-common-palette-overrides
           '((builtin green)
             (comment yellow-faint)
             (constant blue)
             (fnname green-warmer)
             (keyword green-cooler)
             (preprocessor green)
             (docstring green-faint)
             (string magenta-cooler)
             (type cyan-warmer)
             (variable blue-warmer)))

     ;; Mimic `ef-trio-light' theme (from my `ef-themes') for code syntax
     ;; highlighting, while still using the Modus colors (and other
     ;; mappings).
     (setq modus-themes-common-palette-overrides
           '((builtin magenta-cooler)
             (comment yellow-faint)
             (constant magenta-warmer)
             (fnname blue-warmer)
             (keyword magenta)
             (preprocessor red-cooler)
             (docstring magenta-faint)
             (string green-cooler)
             (type cyan-cooler)
             (variable cyan-warmer)))

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Make matching parenthesis more or less intense,  Next: DIY Make box buttons more or less gray,  Prev: DIY Make use of alternative styles for code syntax,  Up: DIY Stylistic variants using palette overrides

8.4.11 DIY Make matching parenthesis more or less intense
---------------------------------------------------------

This is one of my practical examples to override the semantic colors of
the Modus themes (*note Stylistic variants using palette overrides: DIY
Stylistic variants using palette overrides.).  In this code block I show
how to change the background of matching delimiters when
‘show-paren-mode’ is enabled.  I also demonstrate how to enable
underlines for those highlights.

     ;; Change the background to a shade of magenta
     (setq modus-themes-common-palette-overrides
           '((bg-paren-match bg-magenta-intense)))

     ;; Enable underlines by applying a color to them
     (setq modus-themes-common-palette-overrides
           '((bg-paren-match bg-magenta-intense)
             (underline-paren-match fg-main)))

     ;; Do not use any background color and instead apply an intense red
     ;; foreground.
     (setq modus-themes-common-palette-overrides
           '((bg-paren-match unspecified)
             (fg-paren-match red-intense)))

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Make box buttons more or less gray,  Next: DIY Make TODO and DONE more or less intense,  Prev: DIY Make matching parenthesis more or less intense,  Up: DIY Stylistic variants using palette overrides

8.4.12 DIY Make box buttons more or less gray
---------------------------------------------

This is one of my practical examples to override the semantic colors of
the Modus themes (*note Stylistic variants using palette overrides: DIY
Stylistic variants using palette overrides.).  By default, the boxed
buttons that appear in ‘M-x customize’ and related are distinct shades
of gray.  The following set of overrides removes the gray from the
active buttons and amplifies it for the inactive ones.

     (setq modus-themes-common-palette-overrides
           '((bg-button-active bg-main)
             (fg-button-active fg-main)
             (bg-button-inactive bg-inactive)
             (fg-button-inactive "gray50")))

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Make TODO and DONE more or less intense,  Next: DIY Make headings more or less colorful,  Prev: DIY Make box buttons more or less gray,  Up: DIY Stylistic variants using palette overrides

8.4.13 DIY Make TODO and DONE more or less intense
--------------------------------------------------

This is one of my practical examples to override the semantic colors of
the Modus themes (*note Stylistic variants using palette overrides: DIY
Stylistic variants using palette overrides.).  Here I show how to affect
just the ‘TODO’ and ‘DONE’ keywords that I encounter in Org buffers.
The idea is to make those pop out more or to subdue them.

   *note Make headings more or less colorful: DIY Make headings more or
less colorful.

   *note Make inline code in prose use alternative styles: DIY Make
inline code in prose use alternative styles.

     ;; Increase intensity
     (setq modus-themes-common-palette-overrides
           '((prose-done green-intense)
             (prose-todo red-intense)))

     ;; Tone down intensity
     (setq modus-themes-common-palette-overrides
           '((prose-done green-faint)   ; OR replace `green-faint' with `olive'
             (prose-todo red-faint)))   ; OR replace `red-faint' with `rust'

     ;; Keep TODO at its default (so no override for it), but make DONE
     ;; gray.
     (setq modus-themes-common-palette-overrides
           '((prose-done fg-dim)))

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Make headings more or less colorful,  Next: DIY Make Org block colors more or less colorful,  Prev: DIY Make TODO and DONE more or less intense,  Up: DIY Stylistic variants using palette overrides

8.4.14 DIY Make headings more or less colorful
----------------------------------------------

This is one of my practical examples to override the semantic colors of
the Modus themes (*note Stylistic variants using palette overrides: DIY
Stylistic variants using palette overrides.).  Here I show how to alter
the looks of headings, such as in Org mode.  Using overrides here offers
far more flexibility than what I could achieve with previous versions of
the themes: the user can mix and match styles at will.

   *note Make TODO and DONE more intense: DIY Make TODO and DONE more or
less intense.

     ;; Apply more colorful foreground to some headings (headings 0-8).
     ;; Level 0 is for Org #+title and related.
     (setq modus-themes-common-palette-overrides
           '((fg-heading-1 blue-warmer)
             (fg-heading-2 yellow-cooler)
             (fg-heading-3 cyan-cooler)))

     ;; Like the above, but with gradient colors
     (setq modus-themes-common-palette-overrides
           '((fg-heading-1 blue)
             (fg-heading-2 cyan)
             (fg-heading-3 green)))

     ;; Add color to level 1 heading, but use the main foreground for
     ;; others
     (setq modus-themes-common-palette-overrides
           '((fg-heading-1 blue)
             (fg-heading-2 fg-main)
             (fg-heading-3 fg-main)))

     ;; Apply colorful foreground, background, and overline (headings 0-8)
     (setq modus-themes-common-palette-overrides
           '((fg-heading-1 blue-warmer)
             (bg-heading-1 bg-blue-nuanced)
             (overline-heading-1 blue)))

     ;; Apply gray scale foreground, background, and overline (headings 0-8)
     (setq modus-themes-common-palette-overrides
           '((fg-heading-1 fg-main)
             (bg-heading-1 bg-dim)
             (overline-heading-1 border)))

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Make Org block colors more or less colorful,  Next: DIY Make Org agenda more or less colorful,  Prev: DIY Make headings more or less colorful,  Up: DIY Stylistic variants using palette overrides

8.4.15 DIY Make Org block colors more or less colorful
------------------------------------------------------

This is one of my practical examples to override the semantic colors of
the Modus themes (*note Stylistic variants using palette overrides: DIY
Stylistic variants using palette overrides.).  Here I show how to change
the presentation of Org blocks (and other such blocks like Markdown
fenced code sections, though the exact presentation depends on each
major mode).

   The default style of Org blocks is a subtle gray background for the
contents and for the delimiter lines (the ‘#+begin_’ and ‘#+end_’
parts).  The text of the delimiter lines is a subtle gray foreground
color.

   *note Make inline code in prose use alternative styles: DIY Make
inline code in prose use alternative styles.

     ;; Make code blocks (in Org, for example) use a more colorful style
     ;; for their delimiter lines as well as their contents.  Give this a
     ;; purple feel.  Make the delimiter lines distinct from the contents.
     (setq modus-themes-common-palette-overrides
           '((bg-prose-block-contents bg-magenta-nuanced)
             (bg-prose-block-delimiter bg-lavender)
             (fg-prose-block-delimiter fg-main)))

     ;; As above, but with a more blue feel.
     (setq modus-themes-common-palette-overrides
           '((bg-prose-block-contents bg-blue-nuanced)
             (bg-prose-block-delimiter bg-lavender)
             (fg-prose-block-delimiter fg-main)))

     ;; As above, but with a green feel.
     (setq modus-themes-common-palette-overrides
           '((bg-prose-block-contents bg-green-nuanced)
             (bg-prose-block-delimiter bg-sage)
             (fg-prose-block-delimiter fg-main)))

     ;; As above, but with a yellow/gold feel.
     (setq modus-themes-common-palette-overrides
           '((bg-prose-block-contents bg-yellow-nuanced)
             (bg-prose-block-delimiter bg-ochre)
             (fg-prose-block-delimiter fg-main)))

     ;; As above, but with a slightly more red feel.
     (setq modus-themes-common-palette-overrides
           '((bg-prose-block-contents bg-red-nuanced)
             (bg-prose-block-delimiter bg-ochre)
             (fg-prose-block-delimiter fg-main)))

   The previous examples differentiate the delimiter lines from the
block's contents.  Though I can mimic the default aesthetic of a uniform
background, while changing the applicable colors.  Here are some nice
combinations:

     ;; Solid green style.
     (setq modus-themes-common-palette-overrides
           '((bg-prose-block-contents bg-green-nuanced)
             (bg-prose-block-delimiter bg-green-nuanced)
             (fg-prose-block-delimiter green-warmer)))

     ;; Solid yellow style.
     (setq modus-themes-common-palette-overrides
           '((bg-prose-block-contents bg-yellow-nuanced)
             (bg-prose-block-delimiter bg-yellow-nuanced)
             (fg-prose-block-delimiter yellow-cooler)))

     ;; Solid cyan style.
     (setq modus-themes-common-palette-overrides
           '((bg-prose-block-contents bg-cyan-nuanced)
             (bg-prose-block-delimiter bg-cyan-nuanced)
             (fg-prose-block-delimiter cyan-cooler)))

   [ Combine the above with a suitable mode line style for maximum
effect (*note DIY Make the active mode line colorful::).  ]

   Finally, the following makes code blocks have no distinct background.
The minimal styles are applied to the delimiter lines, which only use a
subtle gray foreground.  This was the default for the Modus themes up
until version 4.3.0.

     ;; Make code blocks more minimal, so that (i) the delimiter lines have
     ;; no background, (ii) the delimiter foreground is a subtle gray, and
     ;; (iii) the block contents have no distinct background either.  This
     ;; was the default in versions of the Modus themes before 4.4.0
     (setq modus-themes-common-palette-overrides
           '((bg-prose-block-contents unspecified)
             (bg-prose-block-delimiter unspeficied)
             (fg-prose-block-delimiter fg-dim)))

   *note DIY Use colored Org source blocks per language::.


File: modus-themes.info,  Node: DIY Make Org agenda more or less colorful,  Next: DIY Make inline code in prose use alternative styles,  Prev: DIY Make Org block colors more or less colorful,  Up: DIY Stylistic variants using palette overrides

8.4.16 DIY Make Org agenda more or less colorful
------------------------------------------------

This is one of my practical examples to override the semantic colors of
the Modus themes (*note Stylistic variants using palette overrides: DIY
Stylistic variants using palette overrides.).  Here I provide three
distinct code blocks.  The first adds alternative and more varied colors
to the Org agenda (and related).  The second uses faint coloration.  The
third makes the agenda use various shades of blue.  Mix and match at
will, while also combining these styles with what I show in the other
chapters with practical stylistic variants.

     ;; Make the Org agenda use alternative and varied colors.
     (setq modus-themes-common-palette-overrides
           '((date-common cyan)   ; default value (for timestamps and more)
             (date-deadline red-warmer)
             (date-event magenta-warmer)
             (date-holiday blue) ; for M-x calendar
             (date-now yellow-warmer)
             (date-scheduled magenta-cooler)
             (date-weekday cyan-cooler)
             (date-weekend blue-faint)))

   An example with faint coloration:

     ;; Make the Org agenda use faint colors.
     (setq modus-themes-common-palette-overrides
           '((date-common cyan-faint) ; for timestamps and more
             (date-deadline red-faint)
             (date-event fg-alt) ; default
             (date-holiday magenta) ; default (for M-x calendar)
             (date-now fg-main) ; default
             (date-scheduled yellow-faint)
             (date-weekday fg-alt)
             (date-weekend fg-dim)))

   A third example that makes the agenda more blue:

     ;; Make the Org agenda use more blue instead of yellow and red.
     (setq modus-themes-common-palette-overrides
           '((date-common cyan) ; default value (for timestamps and more)
             (date-deadline blue-cooler)
             (date-event blue-faint)
             (date-holiday blue) ; for M-x calendar
             (date-now blue-faint)
             (date-scheduled blue)
             (date-weekday fg-main)
             (date-weekend fg-dim)))

   Yet another example that also affects ‘DONE’ and ‘TODO’ keywords:

     ;; Change dates to a set of more subtle combinations.  Deadlines are a
     ;; shade of magenta, scheduled dates are a shade of green that
     ;; complements that of the deadlines, weekday headings use the main
     ;; foreground color while weekends are a shade of gray.  The DONE
     ;; keyword is a faint blue-gray while TODO is yellow.
     (setq modus-themes-common-palette-overrides
           '((date-deadline magenta-warmer)
             (date-scheduled green-cooler)
             (date-weekday fg-main)
             (date-event fg-dim)
             (date-now blue)
             (prose-done fg-alt)
             (prose-todo yellow)))

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Make inline code in prose use alternative styles,  Next: DIY Make mail citations and headers more or less colorful,  Prev: DIY Make Org agenda more or less colorful,  Up: DIY Stylistic variants using palette overrides

8.4.17 DIY Make inline code in prose use alternative styles
-----------------------------------------------------------

This is one of my practical examples to override the semantic colors of
the Modus themes (*note Stylistic variants using palette overrides: DIY
Stylistic variants using palette overrides.).  In the following code
block I show how to affect constructs such as Org's verbatim, code, and
macro entries.  I also provide mappings for tables, property drawers,
tags, and code block delimiters, though I do not show every possible
permutation.

   • *note Make TODO and DONE more or less intense: DIY Make TODO and
     DONE more or less intense.
   • *note DIY Make Org block colors more or less colorful::.

     ;; A nuanced accented background, combined with a suitable foreground.
     (setq modus-themes-common-palette-overrides
           '((bg-prose-code bg-green-nuanced)
             (fg-prose-code green-cooler)

             (bg-prose-verbatim bg-magenta-nuanced)
             (fg-prose-verbatim magenta-warmer)

             (bg-prose-macro bg-blue-nuanced)
             (fg-prose-macro magenta-cooler)))

     ;; A more noticeable accented background, combined with a suitable foreground.
     (setq modus-themes-common-palette-overrides
           '((bg-prose-code bg-sage)
             (fg-prose-code green-faint)

             (bg-prose-verbatim bg-ochre)
             (fg-prose-verbatim red-faint)

             (bg-prose-macro bg-lavender)
             (fg-prose-macro blue-faint)))

     ;; Leave the backgrounds without a color and simply make the foregrounds more intense.
     (setq modus-themes-common-palette-overrides
           '((bg-prose-code unspecified)
             (fg-prose-code green-intense)

             (bg-prose-verbatim unspecified)
             (fg-prose-verbatim magenta-intense)

             (bg-prose-macro unspecified)
             (fg-prose-macro cyan-intense)))

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Make mail citations and headers more or less colorful,  Next: DIY Make the region preserve text colors plus other styles,  Prev: DIY Make inline code in prose use alternative styles,  Up: DIY Stylistic variants using palette overrides

8.4.18 DIY Make mail citations and headers more or less colorful
----------------------------------------------------------------

This is one of my practical examples to override the semantic colors of
the Modus themes (*note Stylistic variants using palette overrides: DIY
Stylistic variants using palette overrides.).  In this section I show
how to change the coloration of email message headers and citations.
Before I show the code, this is the anatomy of a message:

     From: Protesilaos <info@protesilaos.com>
     To: Some Person <test@domain.sample>
     Subject: Test subject
     --- Headers above this line; message and citations below ---
     This is some sample text

     > > Older quote
     > Newer quote

   I thus have the following:

     ;; Reduce the intensity of mail citations and headers
     (setq modus-themes-common-palette-overrides
           '((mail-cite-0 cyan-faint)
             (mail-cite-1 yellow-faint)
             (mail-cite-2 green-faint)
             (mail-cite-3 red-faint)
             (mail-part olive)
             (mail-recipient indigo)
             (mail-subject maroon)
             (mail-other slate)))

     ;; Make mail citations more intense; adjust the headers accordingly
     (setq modus-themes-common-palette-overrides
           '((mail-cite-0 blue)
             (mail-cite-1 yellow)
             (mail-cite-2 green)
             (mail-cite-3 magenta)
             (mail-part magenta-cooler)
             (mail-recipient cyan)
             (mail-subject red-warmer)
             (mail-other cyan-cooler)))

     ;; Make all citations faint and neutral; make most headers green but
     ;; use red for the subject lie so that it stands out
     (setq modus-themes-common-palette-overrides
           '((mail-cite-0 fg-dim)
             (mail-cite-1 fg-alt)
             (mail-cite-2 fg-dim)
             (mail-cite-3 fg-alt)
             (mail-part yellow-cooler)
             (mail-recipient green-cooler)
             (mail-subject red-cooler)
             (mail-other green)))

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Make the region preserve text colors plus other styles,  Next: DIY Make mouse highlights more or less colorful,  Prev: DIY Make mail citations and headers more or less colorful,  Up: DIY Stylistic variants using palette overrides

8.4.19 DIY Make the region preserve text colors, plus other styles
------------------------------------------------------------------

This is one of my practical examples to override the semantic colors of
the Modus themes (*note Stylistic variants using palette overrides: DIY
Stylistic variants using palette overrides.).  Here I show how to make
the region respect the underlying text colors or how to make the
background more/less intense while combining it with an appropriate
foreground value.

   *note Do not extend the region background: DIY Do not extend the
region background.

     ;; A background with no specific foreground (use foreground of
     ;; underlying text)
     (setq modus-themes-common-palette-overrides
           '((bg-region bg-ochre) ; try to replace `bg-ochre' with `bg-lavender', `bg-sage'
             (fg-region unspecified)))

     ;; Subtle gray with a prominent blue foreground
     (setq modus-themes-common-palette-overrides
           '((bg-region bg-dim)
             (fg-region blue-cooler)))

     ;; Intense magenta background combined with the main foreground
     (setq modus-themes-common-palette-overrides
           '((bg-region bg-magenta-intense)
             (fg-region fg-main)))

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Make mouse highlights more or less colorful,  Next: DIY Make language underlines less colorful,  Prev: DIY Make the region preserve text colors plus other styles,  Up: DIY Stylistic variants using palette overrides

8.4.20 DIY Make mouse highlights more or less colorful
------------------------------------------------------

This is one of my practical examples to override the semantic colors of
the Modus themes (*note Stylistic variants using palette overrides: DIY
Stylistic variants using palette overrides.).  In the following code
block I show how to affect the semantic color mapping that covers mouse
hover effects and related highlights:

     ;; Make the background an intense yellow
     (setq modus-themes-common-palette-overrides
           '((bg-hover bg-yellow-intense)))

     ;; Make the background subtle green
     (setq modus-themes-common-palette-overrides
           '((bg-hover bg-green-subtle)))

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Make language underlines less colorful,  Next: DIY Make line numbers use alternative styles,  Prev: DIY Make mouse highlights more or less colorful,  Up: DIY Stylistic variants using palette overrides

8.4.21 DIY Make language underlines less colorful
-------------------------------------------------

This is one of my practical examples to override the semantic colors of
the Modus themes (*note Stylistic variants using palette overrides: DIY
Stylistic variants using palette overrides.).  Here I show how to affect
the color of the underlines that are used by code linters and prose
spell checkers.

     ;; Make the underlines less intense
     (setq modus-themes-common-palette-overrides
           '((underline-err red-faint)
             (underline-warning yellow-faint)
             (underline-note cyan-faint)))

     ;; Change the color-coding of the underlines
     (setq modus-themes-common-palette-overrides
           '((underline-err yellow-intense)
             (underline-warning magenta-intense)
             (underline-note green-intense)))

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Make line numbers use alternative styles,  Next: DIY Make diffs use only a foreground,  Prev: DIY Make language underlines less colorful,  Up: DIY Stylistic variants using palette overrides

8.4.22 DIY Make line numbers use alternative styles
---------------------------------------------------

This is one of my practical examples to override the semantic colors of
the Modus themes (*note Stylistic variants using palette overrides: DIY
Stylistic variants using palette overrides.).  In this section I show
how to affect the ‘display-line-numbers-mode’.

     ;; Make line numbers less intense
     (setq modus-themes-common-palette-overrides
           '((fg-line-number-inactive "gray50")
             (fg-line-number-active fg-main)
             (bg-line-number-inactive unspecified)
             (bg-line-number-active unspecified)))

     ;; Like the above, but use a shade of red for the current line number
     (setq modus-themes-common-palette-overrides
           '((fg-line-number-inactive "gray50")
             (fg-line-number-active red-cooler)
             (bg-line-number-inactive unspecified)
             (bg-line-number-active unspecified)))

     ;; Make all numbers more intense, use a more pronounce gray
     ;; background, and make the current line have a colored background
     (setq modus-themes-common-palette-overrides
           '((fg-line-number-inactive fg-main)
             (fg-line-number-active fg-main)
             (bg-line-number-inactive bg-inactive)
             (bg-line-number-active bg-cyan-intense)))

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Make diffs use only a foreground,  Next: DIY Make deuteranopia diffs red and blue instead of yellow and blue,  Prev: DIY Make line numbers use alternative styles,  Up: DIY Stylistic variants using palette overrides

8.4.23 DIY Make diffs use only a foreground
-------------------------------------------

This is one of my practical examples to override the semantic colors of
the Modus themes (*note Stylistic variants using palette overrides: DIY
Stylistic variants using palette overrides.).  In this section I show
how to change diff buffers (e.g.  in ‘magit’) to only use color-coded
text without any added background.  What I basically do is to disable
the applicable backgrounds and then intensify the foregrounds.  Since
the deuteranopia-optimized themes do not use the red-green color coding,
I make an extra set of adjustments for them by overriding their palettes
directly instead of just using the "common" overrides.

     ;; Diffs with only foreground colors.  Word-wise ("refined") diffs
     ;; have a gray background to draw attention to themselves.
     (setq modus-themes-common-palette-overrides
           '((bg-added           unspecified)
             (bg-added-faint     unspecified)
             (bg-added-refine    bg-inactive)
             (fg-added           green)
             (fg-added-intense   green-intense)

             (bg-changed         unspecified)
             (bg-changed-faint   unspecified)
             (bg-changed-refine  bg-inactive)
             (fg-changed         yellow)
             (fg-changed-intense yellow-intense)

             (bg-removed         unspecified)
             (bg-removed-faint   unspecified)
             (bg-removed-refine  bg-inactive)
             (fg-removed         red)
             (fg-removed-intense red-intense)

             (bg-diff-context    unspecified)))

     ;; Because deuteranopia cannot use the typical red-yellow-green
     ;; combination, I need to arrange for a yellow-purple-blue sequence.
     ;; Notice that the above covers the "common" overrides, so I do not
     ;; need to reproduce the whole list of them.
     (setq modus-operandi-deuteranopia-palette-overrides
           '((fg-added           blue)
             (fg-added-intense   blue-intense)

             (fg-changed         magenta-cooler)
             (fg-changed-intense magenta-intense)

             (fg-removed         yellow-warmer)
             (fg-removed-intense yellow-intense)))

     (setq modus-vivendi-deuteranopia-palette-overrides
           '((fg-added           blue)
             (fg-added-intense   blue-intense)

             (fg-changed         magenta-cooler)
             (fg-changed-intense magenta-intense)

             (fg-removed         yellow)
             (fg-removed-intense yellow-intense)))

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Make deuteranopia diffs red and blue instead of yellow and blue,  Prev: DIY Make diffs use only a foreground,  Up: DIY Stylistic variants using palette overrides

8.4.24 DIY Make deuteranopia diffs red and blue instead of yellow and blue
--------------------------------------------------------------------------

This is one of my practical examples to override the semantic colors of
the Modus themes (*note Stylistic variants using palette overrides: DIY
Stylistic variants using palette overrides.).  In this section I show
how to implement a red+blue color coding for diffs in the themes
‘modus-operandi-deuteranopia’ and ‘modus-vivendi-deuteranopia’.  As
those themes are optimized for users with red-green color deficiency,
they do not use the typical red+green color coding for diffs, defaulting
instead to yellow+blue which are discernible.  Users with deuteranomaly
or, generally, those who like a different aesthetic, can use the
following to make diffs use the red+yellow+blue color coding for
removed, changed, and added lines respectively.  This is achieved by
overriding the "changed" and "removed" entries to use the colors of
regular ‘modus-operandi’ and ‘modus-vivendi’.

     (setq modus-operandi-deuteranopia-palette-overrides
           '((bg-changed         "#ffdfa9")
             (bg-changed-faint   "#ffefbf")
             (bg-changed-refine  "#fac090")
             (bg-changed-fringe  "#d7c20a")
             (fg-changed         "#553d00")
             (fg-changed-intense "#655000")

             (bg-removed         "#ffd8d5")
             (bg-removed-faint   "#ffe9e9")
             (bg-removed-refine  "#f3b5af")
             (bg-removed-fringe  "#d84a4f")
             (fg-removed         "#8f1313")
             (fg-removed-intense "#aa2222")))

     (setq modus-vivendi-deuteranopia-palette-overrides
           '((bg-changed         "#363300")
             (bg-changed-faint   "#2a1f00")
             (bg-changed-refine  "#4a4a00")
             (bg-changed-fringe  "#8a7a00")
             (fg-changed         "#efef80")
             (fg-changed-intense "#c0b05f")

             (bg-removed         "#4f1119")
             (bg-removed-faint   "#380a0f")
             (bg-removed-refine  "#781a1f")
             (bg-removed-fringe  "#b81a1f")
             (fg-removed         "#ffbfbf")
             (fg-removed-intense "#ff9095")))

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY More accurate colors in terminal emulators,  Next: DIY Range of color with terminal emulators,  Prev: DIY Stylistic variants using palette overrides,  Up: Advanced customization

8.5 DIY More accurate colors in terminal emulators
==================================================

[ This is based on partial information.  Please help verify and/or
expand these findings.  ]

   The graphical version of Emacs can reproduce color values accurately.
Whereas things get more tricky when Emacs is used in a terminal
emulator, because the terminals' own capabilities determine the number
of colors that may be displayed: the Modus themes don't look as good in
that case.

   There is, however, a way to instruct supported terminal emulators to
use more accurate colors.  In a shell prompt type ‘toe -a | grep direct’
to get a list of relevant terminfo entries.  There should be items such
as ‘xterm-direct’, ‘alacritty-direct’, ‘kitty-direct’.  Once you find
the one that corresponds to your terminal, call Emacs with an
environment variable like ‘TERM=xterm-direct’.  Example that can be
adapted to shell aliases:

     TERM=xterm-direct emacsclient -nw

   Another example that can be bound to a key:

     TERM=xterm-direct uxterm -e emacsclient -nw


File: modus-themes.info,  Node: DIY Range of color with terminal emulators,  Next: DIY Per-theme customization settings,  Prev: DIY More accurate colors in terminal emulators,  Up: Advanced customization

8.6 DIY Range of color with terminal emulators
==============================================

[ This is based on partial information.  Please help verify and/or
expand these findings.  ]

   When Emacs runs in a non-windowed session its color reproduction
capacity is framed or determined by the underlying terminal emulator
(*note More accurate colors in terminal emulators: DIY More accurate
colors in terminal emulators.).  Emacs cannot produce a color that lies
outside the range of what the terminal's color palette renders possible.

   This is immediately noticeable when the terminal's first 16 codes do
not include a pure black value for the ‘termcol0’ entry and a pure white
for ‘termcol15’.  Emacs cannot set the correct background (white for
‘modus-operandi’; black for ‘modus-vivendi’) or foreground (inverse of
the background).  It thus falls back to the closest approximation, which
seldom is appropriate for the purposes of the Modus themes.

   In such a case, the user is expected to update their terminal's color
palette such as by adapting these resources (*note Preview theme
colors::):

     ! Theme: modus-operandi
     ! Description: XTerm port of modus-operandi (Modus themes for GNU Emacs)
     ! Author: Protesilaos, <https://protesilaos.com>
     xterm*background: #ffffff
     xterm*foreground: #000000
     xterm*color0:     #000000
     xterm*color1:     #a60000
     xterm*color2:     #005e00
     xterm*color3:     #813e00
     xterm*color4:     #0031a9
     xterm*color5:     #721045
     xterm*color6:     #00538b
     xterm*color7:     #bfbfbf
     xterm*color8:     #595959
     xterm*color9:     #972500
     xterm*color10:    #315b00
     xterm*color11:    #70480f
     xterm*color12:    #2544bb
     xterm*color13:    #5317ac
     xterm*color14:    #005a5f
     xterm*color15:    #ffffff

     ! Theme: modus-vivendi
     ! Description: XTerm port of modus-vivendi (Modus themes for GNU Emacs)
     ! Author: Protesilaos, <https://protesilaos.com>
     xterm*background: #000000
     xterm*foreground: #ffffff
     xterm*color0:     #000000
     xterm*color1:     #ff8059
     xterm*color2:     #44bc44
     xterm*color3:     #d0bc00
     xterm*color4:     #2fafff
     xterm*color5:     #feacd0
     xterm*color6:     #00d3d0
     xterm*color7:     #bfbfbf
     xterm*color8:     #595959
     xterm*color9:     #ef8b50
     xterm*color10:    #70b900
     xterm*color11:    #c0c530
     xterm*color12:    #79a8ff
     xterm*color13:    #b6a0ff
     xterm*color14:    #6ae4b9
     xterm*color15:    #ffffff


File: modus-themes.info,  Node: DIY Per-theme customization settings,  Next: DIY Do not extend the region background,  Prev: DIY Range of color with terminal emulators,  Up: Advanced customization

8.7 DIY Per-theme customization settings
========================================

If you prefer to maintain different customization options between the
two themes, it is best you write your own functions that first set those
options and then load the relevant theme.  The following code does
exactly that by simply differentiating the two themes on the choice of
bold constructs in code syntax (enabled for one, disabled for the
other).

     (defun my-demo-modus-operandi ()
       (interactive)
       (setq modus-themes-bold-constructs t) ; ENABLE bold
       (modus-themes-load-theme 'modus-operandi))

     (defun my-demo-modus-vivendi ()
       (interactive)
       (setq modus-themes-bold-constructs nil) ; DISABLE bold
       (modus-themes-load-theme 'modus-vivendi))

     (defun my-demo-modus-themes-toggle ()
       (if (eq (car custom-enabled-themes) 'modus-operandi)
           (my-demo-modus-vivendi)
         (my-demo-modus-operandi)))

   Then assign ‘my-demo-modus-themes-toggle’ to a key instead of the
equivalent the themes provide.

   For a more elaborate design, it is better to inspect the source code
of ‘modus-themes-toggle’ and relevant functions.

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Do not extend the region background,  Next: DIY Add padding to the mode line,  Prev: DIY Per-theme customization settings,  Up: Advanced customization

8.8 DIY Do not extend the region background
===========================================

By default, the background of the ‘region’ face extends from the end of
the line to the edge of the window.  To limit it to the end of the line,
I need to override the face's ‘:extend’ attribute.  Adding this to the
Emacs configuration file will suffice:

     ;; Do not extend `region' background past the end of the line.
     (custom-set-faces
      '(region ((t :extend nil))))

   *note Make the region preserve text colors, plus other styles: DIY
Make the region preserve text colors plus other styles.


File: modus-themes.info,  Node: DIY Add padding to the mode line,  Next: DIY Remap face with local value,  Prev: DIY Do not extend the region background,  Up: Advanced customization

8.9 DIY Add padding to the mode line
====================================

[ Consider using the ‘spacious-padding’ package from GNU ELPA (by
Protesilaos) for more than just the mode line.  ]

   Emacs faces do not have a concept of "padding" for the space between
the text and its box boundaries.  I can approximate the effect by adding
a ‘:box’ attribute, making its border several pixels thick, and using
the mode line's background color for it.  This way the thick border will
not stand out and will appear as a continuation of the mode line.

   *note Use theme colors in code with modus-themes-with-colors: Use
theme colors in code with modus-themes-with-colors.

     (defun my-modus-themes-custom-faces (&rest _)
       (modus-themes-with-colors
         (custom-set-faces
          ;; Add "padding" to the mode lines
          `(mode-line ((,c :box (:line-width 10 :color ,bg-mode-line-active))))
          `(mode-line-inactive ((,c :box (:line-width 10 :color ,bg-mode-line-inactive)))))))

     (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces)

   *note Using a hook at the post-load-theme phase: DIY Use a hook at
the post-load-theme phase.

   The above has the effect of removing the border around the mode
lines.  In older versions of the themes, I provided the option for a
padded mode line which could also have borders around it.  Those were
not real border, however, but an underline and an overline.  Adjusting
the above:

     (defun my-modus-themes-custom-faces (&rest _)
       (modus-themes-with-colors
         (custom-set-faces
          ;; Add "padding" to the mode lines
          `(mode-line ((,c :underline ,border-mode-line-active
                           :overline ,border-mode-line-active
                           :box (:line-width 10 :color ,bg-mode-line-active))))
          `(mode-line-inactive ((,c :underline ,border-mode-line-inactive
                                    :overline ,border-mode-line-inactive
                                    :box (:line-width 10 :color ,bg-mode-line-inactive)))))))

     ;; ESSENTIAL to make the underline move to the bottom of the box:
     (setq x-underline-at-descent-line t)

     (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces)

   The reason I no longer provide this option is because it depends on a
non-‘nil’ value for ‘x-underline-at-descent-line’.  That variable
affects ALL underlines, including those of links.  The effect is
intrusive and looks awkward in prose.

   As such, the Modus themes no longer provide that option but instead
offer this piece of documentation to make the user fully aware of the
state of affairs.

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Remap face with local value,  Next: DIY Font configurations for Org and others,  Prev: DIY Add padding to the mode line,  Up: Advanced customization

8.10 DIY Remap face with local value
====================================

There are cases where I need to change the buffer-local attributes of a
face.  This might be because I have my own minor mode that reuses a face
for a particular purpose, such as a line selection tool that activates
‘hl-line-mode’, but I wish to keep it distinct from other buffers.  This
is where ‘face-remap-add-relative’ can be applied and may be combined
with ‘modus-themes-with-colors’ to deliver consistent results.

   *note Use theme colors in code with modus-themes-with-colors: Use
theme colors in code with modus-themes-with-colors.

   In this example I will write a simple interactive function that
adjusts the background color of the ‘region’ face.  This is the sample
code:

     (defvar my-rainbow-region-colors
       (modus-themes-with-colors
         `((red . ,bg-red-subtle)
           (green . ,bg-green-subtle)
           (yellow . ,bg-yellow-subtle)
           (blue . ,bg-blue-subtle)
           (magenta . ,bg-magenta-subtle)
           (cyan . ,bg-cyan-subtle)))
       "Sample list of color values for `my-rainbow-region'.")

     (defun my-rainbow-region (color)
       "Remap buffer-local attribute of `region' using COLOR."
       (interactive
        (list
         (completing-read "Pick a color: " my-rainbow-region-colors)))
       (face-remap-add-relative
        'region
        `( :background ,(alist-get (intern color) my-rainbow-region-colors)
           :foreground ,(face-attribute 'default :foreground))))

   When ‘my-rainbow-region’ is called interactively, it prompts for a
color to use.  The list of candidates is drawn from the car of each
association in ‘my-rainbow-region-colors’ (so "red", "green", etc.).

   To extend this principle, I may write wrapper functions that pass a
color directly.  Those can be useful in tandem with hooks.  Consider
this example:

     (defun my-rainbow-region-magenta ()
       (my-rainbow-region 'magenta))

     (add-hook 'diff-mode-hook #'my-rainbow-region-magenta)

   Whenever I enter a ‘diff-mode’ buffer, I now get a magenta-colored
region.

   Perhaps you may wish to generalize those findings in to a set of
functions that also accept an arbitrary face.  I shall leave the
experimentation up to you.

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Font configurations for Org and others,  Next: DIY Configure bold and italic faces,  Prev: DIY Remap face with local value,  Up: Advanced customization

8.11 DIY Font configurations for Org and others
===============================================

[ Consider using the ‘fontaine’ package from GNU ELPA (by Protesilaos)
for all font-related configurations.  ]

   The themes are designed to optionally cope well with mixed font
configurations.  This mostly concerns ‘org-mode’ and ‘markdown-mode’,
though expect to find it elsewhere like in ‘Info-mode’.

   *note Option for font mixing: Mixed fonts.

   In practice it means that the user can safely opt for a more
prose-friendly proportionately spaced typeface as their default, while
spacing-sensitive elements like tables and inline code always use a
monospaced font, by inheriting from the ‘fixed-pitch’ face.

   Users can try the built-in ‘M-x variable-pitch-mode’ to see the
effect in action.

   To make everything use your desired font families, you need to
configure the ‘variable-pitch’ (proportional spacing) and ‘fixed-pitch’
(monospaced) faces respectively.  It may also be convenient to set your
main typeface by configuring the ‘default’ face the same way.

   Put something like this in your initialization file (also consider
reading the docstring of ‘set-face-attribute’):

     ;; Main typeface
     (set-face-attribute 'default nil :family "DejaVu Sans Mono" :height 110)

     ;; Proportionately spaced typeface
     (set-face-attribute 'variable-pitch nil :family "DejaVu Serif" :height 1.0)

     ;; Monospaced typeface
     (set-face-attribute 'fixed-pitch nil :family "DejaVu Sans Mono" :height 1.5)

   Or employ the ‘face-attribute’ function to read an existing value,
such as if you want to make ‘fixed-pitch’ use the font family of the
‘default’ face:

     (set-face-attribute 'fixed-pitch nil :family (face-attribute 'default :family))

   The next section shows how to make those work in a more elaborate
setup that is robust to changes between the Modus themes.

   *note Configure bold and italic faces: DIY Configure bold and italic
faces.

   Note the differences in the ‘:height’ property.  The ‘default’ face
must specify an absolute value, which is the point size × 10.  So if you
want to use a font at point size ‘11’, you set the height to ‘110’.(1)
Whereas every other face must either not specify a height or have a
value that is relative to the default, represented as a floating point.
If you use an integer, then that means an absolute height.  This is of
paramount importance: it ensures that all fonts can scale gracefully
when using something like the ‘text-scale-adjust’ command which only
operates on the base font size (i.e.  the ‘default’ face's absolute
height).

   *note Note for EWW and Elfeed fonts: Note on SHR fonts.

   ---------- Footnotes ----------

   (1) ‘:height’ values do not need to be rounded to multiples of ten:
the likes of ‘115’ are perfectly valid—some typefaces will change to
account for those finer increments.


File: modus-themes.info,  Node: DIY Configure bold and italic faces,  Next: DIY Custom Org todo keyword and priority faces,  Prev: DIY Font configurations for Org and others,  Up: Advanced customization

8.12 DIY Configure bold and italic faces
========================================

[ Consider using the ‘fontaine’ package from GNU ELPA (by Protesilaos)
for all font-related configurations.  ]

   The Modus themes do not hardcode a ‘:weight’ or ‘:slant’ attribute in
the thousands of faces they cover.  Instead, they configure the generic
faces called ‘bold’ and ‘italic’ to use the appropriate styles and then
instruct all relevant faces that require emphasis to inherit from them.

   This practically means that users can change the particularities of
what it means for a construct to be bold/italic, by tweaking the ‘bold’
and ‘italic’ faces.  Cases where that can be useful include:

   • The default typeface does not have a variant with slanted glyphs
     (e.g.  Fira Mono/Code as of this writing on 2021-07-07), so the
     user wants to add another family for the italics, such as Hack.

   • The typeface of choice provides a multitude of weights and the user
     prefers the light one by default.  To prevent the bold weight from
     being too heavy compared to the light one, they opt to make ‘bold’
     use a semibold weight.

   • The typeface distinguishes between oblique and italic forms by
     providing different font variants (the former are just slanted
     versions of the upright forms, while the latter have distinguishing
     features as well).  In this case, the user wants to specify the
     font that applies to the ‘italic’ face.

   To achieve those effects, one must first be sure that the fonts they
use have support for those features.  It then is a matter of following
the instructions for all typeface tweaks.

   *note Font configurations for Org and others: DIY Font configurations
for Org and others.

   In this example, I set the default font family to Fira Code, while I
choose to render italics in the Hack typeface (obviously you need to
pick fonts that work well together):

     (set-face-attribute 'default nil :family "Fira Code" :height 110)
     (set-face-attribute 'italic nil :family "Hack")

   And here I play with different weights, using Source Code Pro:

     (set-face-attribute 'default nil :family "Source Code Pro" :height 110 :weight 'light)
     (set-face-attribute 'bold nil :weight 'semibold)

   To reset the font family, one can use this:

     (set-face-attribute 'italic nil :family 'unspecified)

   To ensure that the effects persist after switching between the Modus
themes (such as with ‘M-x modus-themes-toggle’), the user needs to write
their configurations to a function and pass it to the
‘modus-themes-after-load-theme-hook’ (*note Enable and load::).  This is
necessary because themes set the styles of faces upon activation,
overriding prior values where conflicts occur between the previous and
the current states (otherwise changing themes would not be possible).

   *note A theme-agnostic hook for theme loading: DIY A theme-agnostic
hook for theme loading.

   This is a minimal setup to preserve font configurations across theme
load phases.  For a more permanent setup, it is better to rely on the
‘custom-set-faces’ function: ‘set-face-attribute’ works just fine,
though it probably is better suited for quick previews or for smaller
scale operations (‘custom-set-faces’ follows the format used in the
source code of the themes, which can make it easier to redefine faces in
bulk).

     ;; my generic function
     (defun my-modes-themes-bold-italic-faces (&rest _)
       (set-face-attribute 'default nil :family "Source Code Pro" :height 110)
       (set-face-attribute 'bold nil :weight 'semibold))

     ;; or use this if you configure a lot of face and attributes and
     ;; especially if you plan to use `modus-themes-with-colors', as shown
     ;; elsewhere in the manual
     (defun my-modes-themes-bold-italic-faces (&rest _)
       (custom-set-faces
        '(default ((t :family "Source Code Pro" :height 110)))
        '(bold ((t :weight semibold)))))

     ;; and here is the hook
     (add-hook 'modus-themes-after-load-theme-hook #'my-modes-themes-bold-italic-faces)

   *note Use theme colors in code with modus-themes-with-colors: Use
theme colors in code with modus-themes-with-colors.

   *note Using a hook at the post-load-theme phase: DIY Use a hook at
the post-load-theme phase.

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Custom Org todo keyword and priority faces,  Next: DIY Custom Org emphasis faces,  Prev: DIY Configure bold and italic faces,  Up: Advanced customization

8.13 DIY Custom Org todo keyword and priority faces
===================================================

Users of ‘org-mode’ have the option to configure various keywords and
priority cookies to better match their workflow.  User options are
‘org-todo-keyword-faces’ and ‘org-priority-faces’.

   As those are meant to be custom faces, it is futile to have the
themes guess what each user wants to use, which keywords to target, and
so on.  Instead, I can provide guidelines on how to customize things to
one's liking with the intent of retaining the overall aesthetic of the
themes.

   Please bear in mind that the end result of those is not controlled by
the active Modus theme but by how Org maps faces to its constructs.
Editing those while ‘org-mode’ is active requires re-initialization of
the mode with ‘M-x org-mode-restart’ for changes to take effect.

   Let us assume you wish to visually differentiate your keywords.  You
have something like this:

     (setq org-todo-keywords
           '((sequence "TODO(t)" "|" "DONE(D)" "CANCEL(C)")
             (sequence "MEET(m)" "|" "MET(M)")
             (sequence "STUDY(s)" "|" "STUDIED(S)")
             (sequence "WRITE(w)" "|" "WROTE(W)")))

   You could then use a variant of the following to inherit from a face
that uses the styles you want and also to preserve the attributes
applied by the ‘org-todo’ face (in case there is a difference between
the two):

     (setq org-todo-keyword-faces
           '(("MEET" . (:inherit (bold org-todo)))
             ("STUDY" . (:inherit (warning org-todo)))
             ("WRITE" . (:inherit (shadow org-todo)))))

   This will refashion the keywords you specify, while letting the other
items in ‘org-todo-keywords’ use their original styles, which are
defined in the ‘org-todo’ and ‘org-done’ faces.

   If you want back the defaults, try specifying just the ‘org-todo’
face:

     (setq org-todo-keyword-faces
           '(("MEET" . org-todo)
             ("STUDY" . org-todo)
             ("WRITE" . org-todo)))

   Or set ‘org-todo-keyword-faces’ to ‘nil’.

   When you inherit from multiple faces, you need to do it the way it is
shown further above.  The order is significant: the first entry is
applied on top of the second, overriding any attributes that are
explicitly set for both of them: any attribute that is not specified is
not overridden, so, for example, if ‘org-todo’ has a background and a
foreground, while ‘font-lock-type-face’ only has a foreground, the
merged face will include the background of the former and the foreground
of the latter.  If you do not want to blend multiple faces, you only
specify one by name without parentheses or an ‘:inherit’ keyword.  A
pattern of ‘keyword . face’ will suffice.

   Both approaches can be used simultaneously, as illustrated in this
configuration of the priority cookies:

     (setq org-priority-faces
           '((?A . (:inherit (bold org-priority)))
             (?B . org-priority)
             (?C . (:inherit (shadow org-priority)))))

   To find all the faces that are loaded in your current Emacs session,
use ‘M-x list-faces-display’.  Try ‘M-x describe-variable’ as well and
then specify the name of each of those Org variables demonstrated above.
Their documentation strings will offer you further guidance.

   Recall that the themes let you retrieve a color from their palette.
Do it if you plan to control face attributes.

   *note Check color combinations: DIY Measure color contrast.


File: modus-themes.info,  Node: DIY Custom Org emphasis faces,  Next: DIY Use colored Org source blocks per language,  Prev: DIY Custom Org todo keyword and priority faces,  Up: Advanced customization

8.14 DIY Custom Org emphasis faces
==================================

Org provides the user option ‘org-emphasis-alist’ which associates a
character with a face, list of faces, or face attributes.  The default
specification of that variable looks like this:

     (setq org-emphasis-alist
           '(("*" bold)
             ("/" italic)
             ("_" underline)
             ("=" org-verbatim verbatim)
             ("~" org-code verbatim)
             ("+" (:strike-through t))))

   With the exception of ‘org-verbatim’ and ‘org-code’ faces, everything
else uses the corresponding type of emphasis: a bold typographic weight,
or italicised, underlined, and struck through text.

   The best way for users to add some extra attributes, such as a
foreground color, is to define their own faces and assign them to the
given emphasis marker/character.

   This is a custom face that extends the standard ‘bold’ face with a
red foreground value (so it colorises the text in addition to the bold
weight):

     (defface my-org-emphasis-bold
       '((default :inherit bold)
         (((class color) (min-colors 88) (background light))
          :foreground "#a60000")
         (((class color) (min-colors 88) (background dark))
          :foreground "#ff8059"))
       "My bold emphasis for Org.")

   This face definition reads as follows:

   • Always inherit the ‘bold’ face (*note Configure bold and italic
     faces: DIY Configure bold and italic faces.).
   • For versions of Emacs that support at least 88 colors (graphical
     Emacs, for example) and use a light background, apply the ‘#a60000’
     value.
   • For the same kind of Emacs that has a dark background use the
     ‘#ff8059’ color instead.

   Same principle for how to extend ‘italic’ and ‘underline’ with, for
example, green and yellow hues, respectively:

     (defface my-org-emphasis-italic
       '((default :inherit italic)
         (((class color) (min-colors 88) (background light))
          :foreground "#005e00")
         (((class color) (min-colors 88) (background dark))
          :foreground "#44bc44"))
       "My italic emphasis for Org.")

     (defface my-org-emphasis-underline
       '((default :inherit underline)
         (((class color) (min-colors 88) (background light))
          :foreground "#813e00")
         (((class color) (min-colors 88) (background dark))
          :foreground "#d0bc00"))
       "My underline emphasis for Org.")

   In the case of a strike-through effect, I have no generic face to
inherit from, so I can write it as follows to also change the foreground
to a more subtle gray:

     (defface my-org-emphasis-strike-through
       '((default :strike-through t)
         (((class color) (min-colors 88) (background light))
          :foreground "#505050")
         (((class color) (min-colors 88) (background dark))
          :foreground "#a8a8a8"))
       "My strike-through emphasis for Org.")

   Or I can just change the color of the line that strikes through the
text to, for example, a shade of red:

     (defface my-org-emphasis-strike-through
       '((((class color) (min-colors 88) (background light))
          :strike-through "#972500")
         (((class color) (min-colors 88) (background dark))
          :strike-through "#ef8b50"))
       "My strike-through emphasis for Org.")

   It is possible to combine those effects:

     (defface my-org-emphasis-strike-through
       '((((class color) (min-colors 88) (background light))
          :strike-through "#972500" :foreground "#505050")
         (((class color) (min-colors 88) (background dark))
          :strike-through "#ef8b50" :foreground "#a8a8a8"))
       "My strike-through emphasis for Org.")

   One may inspect the variables ‘modus-themes-operandi-colors’ and
‘modus-themes-vivendi-colors’ for possible color values.  Or call the
command ‘modus-themes-list-colors’ to show a buffer that previews each
entry in the palette.

   *note Visualize the active Modus theme's palette: Preview theme
colors.

   Once I have defined the faces I need, I must update the
‘org-emphasis-alist’.  Given that ‘org-verbatim’ and ‘org-code’ are
already styled by the themes, it probably is best not to edit them:

     (setq org-emphasis-alist
           '(("*" my-org-emphasis-bold)
             ("/" my-org-emphasis-italic)
             ("_" my-org-emphasis-underline)
             ("=" org-verbatim verbatim)
             ("~" org-code verbatim)
             ("+" my-org-emphasis-strike-through)))

   That's it!  For changes to take effect in already visited Org files,
invoke ‘M-x org-mode-restart’.


File: modus-themes.info,  Node: DIY Use colored Org source blocks per language,  Next: DIY Measure color contrast,  Prev: DIY Custom Org emphasis faces,  Up: Advanced customization

8.15 DIY Use colored Org source blocks per language
===================================================

*note DIY Make Org block colors more or less colorful::.

   In versions of the Modus themes before ‘4.4.0’ there was an option to
change the coloration of Org source blocks so that certain languages
would have a distinctly colored background.  This was not flexible
enough, because (i) I cannot cover all languages effectively and (ii)
the user had no choice over the ‘language --> color’ mapping.

   As such, the old user option is no more.  Users can use the following
to achieve what they want:

   [ All this is done by setting the Org user option
‘org-src-block-faces’, so it is not related to the palette overrides
mechanism provided by the Modus themes.  ]

     (defun my-modus-themes-org-block-faces (&rest _)
       (modus-themes-with-colors
         ;; The `org-src-block-faces' does not get re-applied in existing
         ;; Org buffers.  Do M-x org-mode-restart for changes to take
         ;; effect.
         (setq org-src-block-faces
               `(("emacs-lisp" modus-themes-nuanced-magenta)
                 ("elisp" modus-themes-nuanced-magenta)
                 ("clojure" modus-themes-nuanced-magenta)
                 ("clojurescript" modus-themes-nuanced-magenta)
                 ("c" modus-themes-nuanced-blue)
                 ("c++" modus-themes-nuanced-blue)
                 ("sh" modus-themes-nuanced-yellow)
                 ("shell" modus-themes-nuanced-yellow)
                 ("python" modus-themes-nuanced-yellow)
                 ("ipython" modus-themes-nuanced-yellow)
                 ("r" modus-themes-nuanced-yellow)
                 ("html" modus-themes-nuanced-green)
                 ("xml" modus-themes-nuanced-green)
                 ("css" modus-themes-nuanced-red)
                 ("scss" modus-themes-nuanced-red)
                 ("yaml" modus-themes-nuanced-cyan)
                 ("conf" modus-themes-nuanced-cyan)
                 ("docker" modus-themes-nuanced-cyan)))))

     (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-org-block-faces)

   *note DIY Use a hook at the post-load-theme phase::.

   Note that the ‘org-src-block-faces’ accepts a named face, as shown
above, as well as a list of face attributes.  The latter approach is not
good enough because it hardcodes values in such a way that an
‘org-mode-restart’ is necessary.  Whereas the indirection of the named
face lets the theme change the values while Org buffers continue to show
the right colors.

   Still, if a user prefers to hardcode face attributes, here is the
idea:

     ;; This is for the sake of completeness.  I DO NOT RECOMMEND THIS
     ;; method because it hardcodes values and thus requires
     ;; `org-mode-restart' every time you change a theme.
     (defun my-modus-themes-org-block-faces (&rest _)
       (modus-themes-with-colors
         (setq org-src-block-faces
               `(("emacs-lisp" (:inherit org-block :background ,bg-magenta-nuanced))
                 ("elisp" (:inherit org-block :background ,bg-magenta-nuanced))
                 ("clojure" (:inherit org-block :background ,bg-magenta-nuanced))
                 ("clojurescript" (:inherit org-block :background ,bg-magenta-nuanced))
                 ("c" (:inherit org-block :background ,bg-blue-nuanced))
                 ("c++" (:inherit org-block :background ,bg-blue-nuanced))
                 ("sh" (:inherit org-block :background ,bg-yellow-nuanced))
                 ("shell" (:inherit org-block :background ,bg-yellow-nuanced))
                 ("python" (:inherit org-block :background ,bg-yellow-nuanced))
                 ("ipython" (:inherit org-block :background ,bg-yellow-nuanced))
                 ("r" (:inherit org-block :background ,bg-yellow-nuanced))
                 ("html" (:inherit org-block :background ,bg-green-nuanced))
                 ("xml" (:inherit org-block :background ,bg-green-nuanced))
                 ("css" (:inherit org-block :background ,bg-red-nuanced))
                 ("scss" (:inherit org-block :background ,bg-red-nuanced))
                 ("yaml" (:inherit org-block :background ,bg-cyan-nuanced))
                 ("conf" (:inherit org-block :background ,bg-cyan-nuanced))
                 ("docker" (:inherit org-block :background ,bg-cyan-nuanced))))))

     (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-org-block-faces)


File: modus-themes.info,  Node: DIY Measure color contrast,  Next: DIY Load theme depending on time of day,  Prev: DIY Use colored Org source blocks per language,  Up: Advanced customization

8.16 DIY Measure color contrast
===============================

The themes provide the functions ‘modus-themes-wcag-formula’ and
‘modus-themes-contrast’.  The former is a direct implementation of the
WCAG formula: <https://www.w3.org/TR/WCAG20-TECHS/G18.html>.  It
calculates the relative luminance of a color value that is expressed in
hexadecimal RGB notation.  While the latter function is just a
convenient wrapper for comparing the relative luminance between two
colors.

   In practice, one needs to work only with ‘modus-themes-contrast’.  It
accepts two color values and returns their contrast ratio.  Values range
from 1 to 21 (lowest to highest).  The themes are designed to always be
equal or higher than 7 for each combination of background and foreground
that they use (this is the WCAG AAA standard--the most demanding of its
kind).

   A couple of examples (rounded numbers):

     ;; Pure white with pure green
     (modus-themes-contrast "#ffffff" "#00ff00")
     ;; => 1.37
     ;; That is an outright inaccessible combo

     ;; Pure black with pure green
     (modus-themes-contrast "#000000" "#00ff00")
     ;; => 15.3
     ;; That is a highly accessible combo

   It does not matter which color value comes first.  The ratio is
always the same.

   If one does not wish to read all the decimal points, it is possible
to try something like this:

     (format "%0.2f" (modus-themes-contrast "#000000" "#00ff00"))

   While it is fine to perform such calculations on a case-by-case
basis, it is preferable to implement formulas and tables for more
demanding tasks.  Such instruments are provided by ‘org-mode’ or
‘orgtbl-mode’, both of which are built into Emacs.  Below is such a
table that derives the contrast ratio of all colors in the first column
(pure red, green, blue) relative to the color specified in the first row
of the second column (pure white) and rounds the results:

     |         | #ffffff |
     |---------+---------|
     | #ff0000 |    4.00 |
     | #00ff00 |    1.37 |
     | #0000ff |    8.59 |
     #+tblfm: $2='(modus-themes-contrast $1 @1$2);%0.2f

   To measure color contrast one needs to start from a known value.
This typically is the background.  The Modus themes define an expanded
palette in large part because certain colors are only meant to be used
in combination with some others.  Consult the source code for the
minutia and relevant commentary.

   Such knowledge may prove valuable while attempting to customize the
theme's color palette.


File: modus-themes.info,  Node: DIY Load theme depending on time of day,  Next: DIY Backdrop for pdf-tools,  Prev: DIY Measure color contrast,  Up: Advanced customization

8.17 DIY Load theme depending on time of day
============================================

While I do provide ‘modus-themes-toggle’ to manually switch between the
themes, users may also set up their system to perform such a task
automatically at sunrise and sunset.

   This can be accomplished by specifying the coordinates of one's
location using the built-in ‘solar.el’ and then configuring the
‘circadian’ package:

     (use-package solar                      ; built-in
       :config
       (setq calendar-latitude 35.17
             calendar-longitude 33.36))

     (use-package circadian                  ; you need to install this
       :ensure t
       :after solar
       :config
       (setq circadian-themes '((:sunrise . modus-operandi)
                                (:sunset  . modus-vivendi)))
       (circadian-setup))


File: modus-themes.info,  Node: DIY Backdrop for pdf-tools,  Next: DIY Toggle themes without reloading them,  Prev: DIY Load theme depending on time of day,  Up: Advanced customization

8.18 DIY Backdrop for pdf-tools
===============================

Most PDF files use a white background for their page, making it
impossible to discern the file's boundaries in the buffer while using
the Modus Operandi theme.  To introduce a distinction between the
buffer's backdrop and the PDF page's background, the former must be
rendered as some shade of gray.  Ideally, ‘pdf-tools’ would provide a
face that the themes could support directly, though this does not seem
to be the case for the time being.  I must thus employ the face
remapping technique that is documented elsewhere in this document to
change the buffer-local value of the ‘default’ face.

   *note Remap face with local value: DIY Remap face with local value.

   To remap the buffer's backdrop, I start with a function like this
one:

     (defun my-pdf-tools-backdrop (&rest _)
       (modus-themes-with-colors
         (face-remap-add-relative
          'default
          `(:background ,bg-dim))))

     (add-hook 'pdf-tools-enabled-hook #'my-pdf-tools-backdrop)

   The idea is to assign that function to a hook that gets called when
‘pdf-tools’ renders the document: ‘pdf-tools-enabled-hook’.  This is
enough when you only use one theme.  However it has the downside of
setting the background color value only at render time.  In other words,
the face remapping function does not get evaluated anew whenever the
theme changes, such as upon invoking ‘M-x modus-themes-toggle’ (*note
Option for which themes to toggle::).

   To have my face remapping adapt gracefully while switching between
the Modus themes, I need to also account for the current theme and
control the activation of ‘pdf-view-midnight-minor-mode’.  To which end
I arrive at something like the following, which builds on the above
example:

     (defun my-pdf-tools-backdrop (&rest _)
       (modus-themes-with-colors
         (face-remap-add-relative
          'default
          `(:background ,bg-dim))))

     (defun my-pdf-tools-midnight-mode-toggle (&rest _)
       (when (derived-mode-p 'pdf-view-mode)
         (if (eq (car custom-enabled-themes) 'modus-vivendi)
             (pdf-view-midnight-minor-mode 1)
           (pdf-view-midnight-minor-mode -1))
         (my-pdf-tools-backdrop)))

     (defun my-pdf-tools-themes-toggle (&rest _)
       (mapc
        (lambda (buf)
          (with-current-buffer buf
            (my-pdf-tools-midnight-mode-toggle)))
        (buffer-list)))

     (add-hook 'pdf-tools-enabled-hook #'my-pdf-tools-midnight-mode-toggle)
     (add-hook 'modus-themes-after-load-theme-hook #'my-pdf-tools-themes-toggle)

   *note Using a hook at the post-load-theme phase: DIY Use a hook at
the post-load-theme phase.

   With those in place, PDFs have a distinct backdrop for their page,
while buffers with major-mode as ‘pdf-view-mode’ automatically switches
to dark mode when ‘modus-themes-toggle’ is called.

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Toggle themes without reloading them,  Next: DIY Use more spacious margins or padding in Emacs frames,  Prev: DIY Backdrop for pdf-tools,  Up: Advanced customization

8.19 DIY Toggle themes without reloading them
=============================================

Users who have a stable setup and who only ever need to toggle between
the themes without triggering a full reload, are better off defining
their own command which calls ‘enable-theme’ instead of ‘load-theme’:

     (defun my-modus-themes-toggle ()
       "Toggle between `modus-operandi' and `modus-vivendi' themes.
     This uses `enable-theme' instead of the standard method of
     `load-theme'.  The technicalities are covered in the Modus themes
     manual."
       (interactive)
       (pcase (modus-themes--current-theme)
         ('modus-operandi (progn (enable-theme 'modus-vivendi)
                                 (disable-theme 'modus-operandi)))
         ('modus-vivendi (progn (enable-theme 'modus-operandi)
                                 (disable-theme 'modus-vivendi)))
         (_ (error "No Modus theme is loaded; evaluate `modus-themes-load-themes' first"))))

   *note Difference between loading and enabling::.

   Recall that ‘modus-themes-toggle’ uses ‘load-theme’.


File: modus-themes.info,  Node: DIY Use more spacious margins or padding in Emacs frames,  Next: DIY Custom hl-todo colors,  Prev: DIY Toggle themes without reloading them,  Up: Advanced customization

8.20 DIY Use more spacious margins or padding in Emacs frames
=============================================================

[ UPDATE 2023-06-25: Instead of following these instructions, you can
simply install my ‘spacious-padding’ package from GNU ELPA.  It
implements the padding and provides relevant user options.  ]

   By default, Emacs frames try to maximize the number of characters
that fit in the current visible portion of the buffer.  Users may prefer
to have some extra padding instead.  This can make Emacs frames look
more pleasant, but also make it easier to identify the currently active
window.

   The way to implement such padding is two-fold:

  1. In the ‘early-init.el’ file instruct Emacs to use a higher value
     for the ‘internal-border-width’ of all frames, as well as for the
     ‘right-divider-width’.  The former concerns the outer boundaries of
     Emacs frames, while the latter pertains to dividers between Emacs
     windows.

  2. Make the relevant faces invisible by changing the value of their
     relevant attributes to that of the current theme's main background.

   The parameters of Emacs frames are specified in the variables
‘initial-frame-alist’ and ‘default-frame-alist’.  The "initial frame"
refers to the first frame that appears on Emacs startup.  The "default"
refers to the fallback values that apply to all other frames that Emacs
creates (unless those are explicitly overridden by a bespoke
‘make-frame’ call).

   In detail, first I use the same values for the two frame alist
variables:

     ;; This must go in the early-init.el so that it applies to the initial
     ;; frame.
     (dolist (var '(default-frame-alist initial-frame-alist))
       (add-to-list var '(right-divider-width . 20))
       (add-to-list var '(internal-border-width . 20)))

   What the ‘dolist’ does is to call ‘add-to-list’ for the two variables
I specify there.  This economizes on typing.

   Then I define a function that makes the relevant faces invisible.
The reason I do this with a function is so I can hook it to the "post
load" phase of a theme, thus applying the new background value
(otherwise you keep the old background, which likely means that the
faces will no longer be invisible).

     (defun my-modus-themes-invisible-dividers (&rest _)
       "Make window dividers invisible.
     Add this to the `modus-themes-post-load-hook'."
       (let ((bg (face-background 'default)))
         (custom-set-faces
          `(fringe ((t :background ,bg :foreground ,bg)))
          `(window-divider ((t :background ,bg :foreground ,bg)))
          `(window-divider-first-pixel ((t :background ,bg :foreground ,bg)))
          `(window-divider-last-pixel ((t :background ,bg :foreground ,bg))))))

     (add-hook 'modus-themes-post-load-hook #'my-modus-themes-invisible-dividers)

   *note Using a hook at the post-load-theme phase: DIY Use a hook at
the post-load-theme phase.

   The above will work only for themes that belong to the Modus family.
For users of Emacs version 29 or higher, there exists a theme-agnostic
hook that takes a function with one argument--that of the theme--and
calls in the the "post enable" phase of theme loading.  Here is the
above snippet, with the necessary tweaks:

     (defun my-modus-themes-invisible-dividers (&rest _)
       "Make window dividers for THEME invisible."
       (let ((bg (face-background 'default)))
         (custom-set-faces
          `(fringe ((t :background ,bg :foreground ,bg)))
          `(window-divider ((t :background ,bg :foreground ,bg)))
          `(window-divider-first-pixel ((t :background ,bg :foreground ,bg)))
          `(window-divider-last-pixel ((t :background ,bg :foreground ,bg))))))

     (add-hook 'enable-theme-functions #'my-modus-themes-invisible-dividers)

   Users of older versions of Emacs can read the entry herein about
defining their own theme-agnostic hook (*note A theme-agnostic hook for
theme loading: DIY A theme-agnostic hook for theme loading.).


File: modus-themes.info,  Node: DIY Custom hl-todo colors,  Next: DIY Add support for solaire-mode,  Prev: DIY Use more spacious margins or padding in Emacs frames,  Up: Advanced customization

8.21 DIY Custom hl-todo colors
==============================

The ‘hl-todo’ package provides the user option ‘hl-todo-keyword-faces’:
it specifies a pair of keyword and corresponding color value.  The Modus
themes configure that option in the interest of legibility.  While this
works for my purposes, users may still prefer to apply their custom
values, in which case the following approach is necessary:

     (defun my-modus-themes-hl-todo-faces (&rest _)
       (setq hl-todo-keyword-faces '(("TODO" . "#ff0000")
                                     ("HACK" . "#ffff00")
                                     ("XXX" . "#00ffff")
                                     ("NOTE" . "#ff00ff"))))

     (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-hl-todo-faces)

   *note Using a hook at the post-load-theme phase: DIY Use a hook at
the post-load-theme phase.

   Or include a ‘let’ form, if needed:

     (defun my-modus-themes-hl-todo-faces (&rest _)
       (let ((red "#ff0000")
             (blue "#0000ff"))
         (setq hl-todo-keyword-faces `(("TODO" . ,blue)
                                       ("HACK" . ,red)
                                       ("XXX" . ,red)
                                       ("NOTE" . ,blue)))))

     (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-hl-todo-faces)

   *note Using a hook at the post-load-theme phase: DIY Use a hook at
the post-load-theme phase.

   Normally, I do not touch user options, though this is an exception:
otherwise the defaults are not always legible.

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Add support for solaire-mode,  Next: DIY Add support for meow-mode,  Prev: DIY Custom hl-todo colors,  Up: Advanced customization

8.22 DIY Add support for solaire-mode
=====================================

The ‘solaire-mode’ package dims the background of what it considers
ancillary "UI" buffers, such as the minibuffer and Dired buffers.  The
Modus themes used to support Solaire on the premise that the user was
(i) opting in to it, (ii) understood why certain buffers were more gray,
and (iii) knew what other adjustments had to be made to prevent broken
visuals (e.g.  the default style of the ‘modus-themes-completions’ uses
a subtle gray background for the selection, which with Solaire becomes
practically invisible).

   However, the assumption that users opt in to this feature does not
always hold true.  There are cases where it is enabled by defaultsuch as
in the popular Doom Emacs configuration.  Thus, the unsuspecting user
who loads ‘modus-operandi’ or ‘modus-vivendi’ without the requisite
customizations is getting a sub-par experience; an experience that I did
not intend and cannot genuinely fix.

   Because the Modus themes are meant to work everywhere, I cannot make
an exception for Doom Emacs and/or Solaire users.  Furthermore, I shall
not introduce hacks, such as by adding a check in all relevant faces to
be adjusted based on Solaire or whatever other package.  Hacks of this
sort are unsustainable and penalize the entire userbase.  Besides, the
themes are built into Emacs and I must keep their standard high.

   The fundamental constraint with Solaire is that Emacs does not have a
real distinction between "content" and "UI" buffers.  For themes to work
with Solaire, they need to be designed around that package.  Such is an
arrangement that compromises on my accessibility standards and/or
hinders my efforts to provide the best possible experience while using
the Modus themes.

   As such, ‘solaire-mode’ is not--and will not be--supported by the
Modus themes (or any other of my themes, for that matter).  Users who
want it must style the faces manually.  Below is some sample code, based
on what I cover at length elsewhere in this manual:

   *note Advanced customization::.

   *note Use theme colors in code with modus-themes-with-colors: Use
theme colors in code with modus-themes-with-colors.

     (defun my-modus-themes-custom-faces (&rest _)
       (modus-themes-with-colors
         (custom-set-faces
          `(solaire-default-face ((,c :inherit default :background ,bg-dim :foreground ,fg-dim)))
          `(solaire-line-number-face ((,c :inherit solaire-default-face :foreground ,fg-dim)))
          `(solaire-hl-line-face ((,c :background ,bg-active)))
          `(solaire-org-hide-face ((,c :background ,bg-dim :foreground ,bg-dim))))))

     (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces)

   *note Using a hook at the post-load-theme phase: DIY Use a hook at
the post-load-theme phase.

   Reload the theme for changes to take effect.


File: modus-themes.info,  Node: DIY Add support for meow-mode,  Next: DIY Add support for combobulate,  Prev: DIY Add support for solaire-mode,  Up: Advanced customization

8.23 DIY Add support for meow-mode
==================================

The ‘meow’ package provides a modal editing experience.  It is meant to
build on top of the key bindings the user is already familiar with.  My
problem as an outsider is that I cannot make sense of all the contexts
where its faces are used in, so I cannot make a good choice of which
styles to use.  The following is but a basic attempt to get started.

     ;; This is not complete, because it is difficult for a non-user to
     ;; make sense of where all the faces are used in.
     (defun my-modus-themes-custom-faces (&rest _)
       (modus-themes-with-colors
         (custom-set-faces
          ;; FIXME: What is a "region cursor" and should it differ from the position highlights below?
          `(meow-region-cursor-1 ((,c :inherit (bold modus-themes-search-current modus-themes-reset-soft))))
          `(meow-region-cursor-2 ((,c :inherit (bold modus-themes-search-current modus-themes-reset-soft))))
          `(meow-region-cursor-3 ((,c :inherit (bold modus-themes-search-current modus-themes-reset-soft))))

          `(meow-position-highlight-number-1 ((,c :inherit (bold modus-themes-search-current modus-themes-reset-soft))))
          `(meow-position-highlight-number-2 ((,c :inherit (bold modus-themes-search-current modus-themes-reset-soft))))
          `(meow-position-highlight-number-3 ((,c :inherit (bold modus-themes-search-current modus-themes-reset-soft)))))))

     (add-hook 'enable-theme-functions #'my-modus-themes-custom-faces)

   *note Using a hook at the post-load-theme phase: DIY Use a hook at
the post-load-theme phase.


File: modus-themes.info,  Node: DIY Add support for combobulate,  Next: DIY Use a hook at the post-load-theme phase,  Prev: DIY Add support for meow-mode,  Up: Advanced customization

8.24 DIY Add support for combobulate
====================================

The ‘combobulate’ package provides the means to operate on text that is
underpinned by the ‘tree-sitter’ program.  Because this is a specialized
case that requires intimate knowledge of the technicalities, I am not
adding support for this package directly at the theme level.  Users can
try this instead:

     (defun my-modus-themes-custom-faces (&rest _)
       (modus-themes-with-colors
         (custom-set-faces
          `(combobulate-active-indicator-face ((,c :foreground ,fg-main)))
          `(combobulate-dimmed-indicator-face ((,c :inherit shadow)))
          `(combobulate-error-indicator-face ((,c :inherit error)))
          `(combobulate-query-highlight-fiery-flames-face ((,c :inherit modus-themes-intense-red)))
          `(combobulate-query-highlight-gleaming-gold-face ((,c :inherit modus-themes-intense-yellow)))
          `(combobulate-query-highlight-majestic-mercury-face ((,c :inherit modus-themes-intense-cyan)))
          `(combobulate-query-highlight-mysterious-mauve-face ((,c :inherit modus-themes-intense-magenta)))
          `(combobulate-query-highlight-radiant-rind-face ((,c :inherit modus-themes-subtle-red)))
          `(combobulate-query-highlight-regal-ripples-face ((,c :inherit modus-themes-intense-blue)))
          `(combobulate-query-highlight-serene-shade-face ((,c :inherit modus-themes-subtle-green)))
          `(combobulate-query-highlight-silver-shadows-face ((,c :background ,bg-active :foreground ,fg-main)))
          `(combobulate-query-highlight-vibrant-veggie-face ((,c :inherit modus-themes-intense-green)))
          `(combobulate-query-query-anonymous-face ((,c :inherit modus-themes-bold :foreground ,fg-alt)))
          `(combobulate-query-query-builtin-face ((,c :inherit font-lock-builtin-face)))
          `(combobulate-query-query-constant-face ((,c :inherit font-lock-constant-face)))
          `(combobulate-query-query-doc-markup-face ((,c :inherit font-lock-doc-markup-face)))
          `(combobulate-query-query-keyword-face ((,c :inherit font-lock-keyword-face)))
          `(combobulate-query-query-predicate-builtin-face ((,c :inherit bold)))
          `(combobulate-query-query-string-face ((,c :inherit font-lock-string-face)))
          `(combobulate-refactor-choice-face ((,c :inherit modus-themes-slant :foreground ,info)))
          `(combobulate-refactor-cursor-face ((,c :foreground ,cursor)))
          `(combobulate-refactor-field-face ((,c :background ,bg-inactive :foreground ,fg-main :extend nil)))
          `(combobulate-refactor-highlight-face ((,c :inherit highlight)))
          `(combobulate-refactor-inactive-choice-face ((,c :inherit modus-themes-slant :foreground ,fg-dim)))
          `(combobulate-refactor-inactive-field-face ((,c :background ,bg-dim :foreground ,fg-dim :extend nil)))
          `(combobulate-refactor-label-face ((,c :inherit modus-themes-search-replace)))
          `(combobulate-tree-branch-face ((,c :inherit shadow)))
          `(combobulate-tree-highlighted-node-face ((,c :inherit success)))
          `(combobulate-tree-normal-node-face ((,c :foreground ,fg-main)))
          `(combobulate-tree-pulse-node-face ((,c :background ,bg-blue-intense :extend t))))))

     (add-hook 'enable-theme-functions #'my-modus-themes-custom-faces)

   *note Using a hook at the post-load-theme phase: DIY Use a hook at
the post-load-theme phase.


File: modus-themes.info,  Node: DIY Use a hook at the post-load-theme phase,  Prev: DIY Add support for combobulate,  Up: Advanced customization

8.25 DIY Use a hook at the post-load-theme phase
================================================

Many of the Do-It-Yourself (DIY) snippets provided herein make use of a
hook to apply the desired changes.  In most examples, this hook is the
‘modus-themes-after-load-theme-hook’ (alias
‘modus-themes-post-load-hook’).  This hook is provided by the Modus
themes and is called at the end of one the following (or their
derivatives):

Command ‘modus-themes-toggle’
     *note Option for which themes to toggle::.

Command ‘modus-themes-rotate’
     *note Option for which themes to rotate::.

Command ‘modus-themes-select’
     Select a Modus theme using minibuffer completion and then load it.

Function ‘modus-themes-load-theme’
     Called only from Lisp, such as in the user's init file, with the
     quoted symbol of a Modus theme as an argument (*note Option for
     disabling other themes while loading Modus: Disable other themes.).
     This function is used internally by ‘modus-themes-toggle’ and
     ‘modus-themes-select’.

   Users who switch between themes that are not limited to the Modus
collection cannot benefit from the aforementioned hook: it only works
with the Modus themes.  A theme-agnostic hook is needed in such a case.
Before Emacs 29, this had to be set up manually (*note DIY A
theme-agnostic hook for theme loading::).  Starting with Emacs 29, the
special hook ‘enable-theme-functions’ works with anything that uses the
basic ‘enable-theme’ function.

   To use the ‘enable-theme-functions’ just add the given function to it
the way it is done with every hook:

     (add-hook 'enable-theme-functions 'MY-FUNCTION-HERE)

   Functions added to ‘enable-theme-functions’ accept a single ‘THEME’
argument.  The examples shown in this manual use the pattern ‘(&rest
_)’, which is how a function accepts one or more arguments but declares
it will not use them (in plain terms, the code works with or without
‘enable-theme-functions’).

* Menu:

* DIY A theme-agnostic hook for theme loading::


File: modus-themes.info,  Node: DIY A theme-agnostic hook for theme loading,  Up: DIY Use a hook at the post-load-theme phase

8.25.1 DIY A theme-agnostic hook for theme loading
--------------------------------------------------

[ NOTE: The following is for versions of Emacs before 29.  For Emacs 29
or higher, users can rely on the built-in ‘enable-theme-functions’
(*note Using a hook at the post-load-theme phase: DIY Use a hook at the
post-load-theme phase.).  ]

   The themes are designed with the intent to be useful to Emacs users
of varying skill levels, from beginners to experts.  This means that I
try to make things easier by not expecting anyone reading this document
to be proficient in Emacs Lisp or programming in general.

   Such a case is with the use of ‘modus-themes-after-load-theme-hook’,
which runs after the ‘modus-themes-load-theme’ function (used by the
command ‘modus-themes-toggle’).  I recommend using that hook for
advanced customizations, because (1) I know for sure that it is
available once the themes are loaded, and (2) anyone consulting this
manual, especially the sections on enabling and loading the themes, will
be in a good position to benefit from that hook.

   Advanced users who have a need to switch between the Modus themes and
other items will find that such a hook does not meet their requirements:
it only works with the Modus themes and only with the aforementioned
functions.

   A theme-agnostic setup can be configured thus:

     (defvar after-enable-theme-hook nil
        "Normal hook run after enabling a theme.")

     (defun run-after-enable-theme-hook (&rest _args)
        "Run `after-enable-theme-hook'."
        (run-hooks 'after-enable-theme-hook))

     (advice-add 'enable-theme :after #'run-after-enable-theme-hook)

   This creates the ‘after-enable-theme-hook’ and makes it run after
each call to ‘enable-theme’, which means that it will work for all
themes and also has the benefit that it does not depend on functions
such as ‘modus-themes-toggle’ and the others mentioned above.
‘enable-theme’ is called internally by ‘load-theme’, so the hook works
everywhere.

   The downside of the theme-agnostic hook is that any functions added
to it will likely not be able to benefit from macro calls that read the
active theme, such as ‘modus-themes-with-colors’.  Not all Emacs themes
have the same capabilities.

   In this document, I cover ‘modus-themes-after-load-theme-hook’ though
the user can replace it with ‘after-enable-theme-hook’ should they need
to (provided they understand the implications).


File: modus-themes.info,  Node: Build on top of the Modus themes,  Next: Face coverage,  Prev: Advanced customization,  Up: Top

9 Build on top of the Modus themes
**********************************

This section concerns package developers or advanced users.

   The Modus themes can be used as the basis for another theme.  The
‘ef-themes’ and ‘standard-themes’ packages (also by Protesilaos), are
two such case.  Developers may build on top of Modus to benefit from the
extensive customization of the Modus themes and the fact that they are
part of core Emacs.  Note that because the ‘ef-themes’ and
‘standard-themes’ existed before they were redone on top of Modus, they
have to provide lots of compatibility aliases.  Whereas a new theme can
be as simple as a single file that only calls ‘modus-themes-theme’.
This manual covers everything in detail with examples that can be
copy-pasted directly, both for private use or to create a new package
(*note Complete example of a Modus derivative theme::).

   A theme exists in a file whose directory is in the
‘custom-theme-load-path’.  The theme file is named ‘NAME-theme.el’.  For
example, the ‘modus-operandi’ theme is in the file
‘modus-operandi-theme.el’.  A theme object can be instantiated with the
function ‘modus-themes-theme’.  This function takes care to (i) declare
the theme, (ii) add to it relevant ‘theme-properties’, (iii) register it
in the ‘modus-themes-registered-items’, (iv) make it work with all the
faces and customizations documented in this manual, and (v)
‘provide-theme’ the theme.

   Concretely, ‘modus-themes-theme’ expects the following mandatory
arguments:

‘NAME’
     The name of the new theme as a symbol, like ‘modus-operandi’.
‘FAMILY’
     The collection this theme is a member of as a symbol, like
     ‘modus-themes’.
‘DESCRIPTION’
     A string describing the theme.
‘BACKGROUND-MODE’
     The symbol ‘dark’ or ‘light’, in reference to the theme's
     background color.
‘CORE-PALETTE’
     The symbol of a variable containing a palette with named colors and
     semantic mappings, like ‘modus-operandi-palette’.  A palette that
     does not have at least all the entries of a default Modus palette
     will eventually not work properly because some face definition will
     expect a given color.  Though the macro does not impose any check
     in this regard.
‘USER-PALETTE’
     The symbol of a user-defined extension to the ‘CORE-PALETTE’,
     commensurate with it, though with arbitrary entries.  This can be
     nil, a fully fledged palette, or a short list of entries.  Any
     colors defined therein are treated the same as the ‘CORE-PALETTE’
     and can, in practice, be used to apply distinct styles to the
     ‘CUSTOM-FACES’ and ‘CUSTOM-VARIABLES’ (more below).
‘OVERRIDES-PALETTE’
     The symbol of a palette that contains overrides for the above two
     palettes.  It is functionally equivalent to the ‘USER-PALETTE’,
     except it is meant to be customized by the end user.  Its value can
     also be nil.
Optional ‘CUSTOM-FACES’
     The symbol of a variable with list of face definitions like those
     in ‘modus-themes-faces’, to extend or modify what core Modus
     defines.  If provided, they override whatever definition is present
     in ‘modus-themes-faces’ in case of a conflict.  Derivative themes
     can thus deviate from the style of core Modus, wherever necessary.
Optional ‘CUSTOM-VARIABLES’
     The symbol of a variable with a list of custom variables (typically
     user options) like those defined in
     ‘modus-themes-custom-variables’.  They also override the core Modus
     definitions in case of a conflict.

   This is an example of a theme that builds on top of ‘modus-operandi’,
passing all the mandatory arguments, but not the optional ones:

     (modus-themes-theme
       'ef-summer
       'ef-themes
       "Legible light warm pink theme with magenta, purple, gold, cyan colors."
       'light
       'modus-operandi-palette
       'ef-summer-palette
       'ef-summer-palette-overrides)

   Here I notice how ‘ef-summer’ has ‘modus-operandi-palette’ as its
‘CORE-PALETTE’.  This means that if the ‘ef-summer-palette’ lacks some
entry, the theme will still work and it will inherit the style of
‘modus-operandi’ for that specific element.

   The ‘modus-themes-theme’ macro does not try to be smart about the
arguments it is given.  It will thus not make any attempt to test if the
variables are bound, nor will it declare any customization options.  In
the above example, the ‘ef-summer-palette-overrides’ is a user option
that is declared in that theme's file.

   In addition to defining their own colors, themes can provide an
entirely custom list of face definitions and customization options.
This mirrors the style of ‘modus-themes-faces’ and
‘modus-themes-custom-variables’, as already noted.  For example, the
‘standard-themes’ have a pseudo-3D style for their active mode line.
They are declared this way:

     (modus-themes-theme
       'standard-dark
       'standard-themes
       "Like the unthemed dark Emacs, but more consistent."
       'dark
       'modus-vivendi-palette
       'standard-dark-palette
       'standard-dard-palette-overrides
       'standard-themes-custom-faces) ; NOTE the additional optional argument

   The ‘standard-themes-custom-faces’ in this example specifies a list
of face definitions like this:

     ;; Simplified example for illustration purposes
     (defconst standard-themes-custom-faces
       '(
         `(mode-line ((,c :box (:style released-button :color ,border-mode-line-active))))))

   Custom faces can still rely on semantic palette mappings, as
illustrated herein where ‘border-mode-line-active’ corresponds to some
named color in the palette of the active theme.

* Menu:

* Complete example of a Modus derivative theme::
* Determine what counts as a Modus theme::
* Create convenience commands to load a derivative theme::
* Arrange to activate your derivative themes::


File: modus-themes.info,  Node: Complete example of a Modus derivative theme,  Next: Determine what counts as a Modus theme,  Up: Build on top of the Modus themes

9.1 Complete example of a Modus derivative theme
================================================

[ For more context: *note Build on top of the Modus themes::.  ]

   In this section, I show how to define a new Modus derivative theme.
In its simplest form, a theme is a file called ‘NAME-theme.el’ in a
directory that is part of the ‘custom-theme-load-path’.  I show how to
do this for a package and for a private configuration:

   • *note Complete example of a package that is derived from Modus::
   • *note Complete example of a private theme derived from Modus::

* Menu:

* Complete example of a package that is derived from Modus::
* Complete example of a private theme derived from Modus::
* Complete example of a custom theme with its own palette::
* Complete example that also uses modus-themes-generate-palette::


File: modus-themes.info,  Node: Complete example of a package that is derived from Modus,  Next: Complete example of a private theme derived from Modus,  Up: Complete example of a Modus derivative theme

9.1.1 Complete example of a package that is derived from Modus
--------------------------------------------------------------

For package developers, the following snippet needs to be included in
each theme file (*note Complete example of a private theme derived from
Modus::):

     ;;;; Add themes from this package to the `custom-theme-load-path'

     ;;;###autoload
     (when load-file-name
       (let ((dir (file-name-directory load-file-name)))
           (add-to-list 'custom-theme-load-path dir)))

   If the package provides many themes, then the above snippet can be
included in a shared file that is then loaded via ‘require’ in the
individual theme files.

   For example, the family of themes that includes ‘prot-light-theme.el’
and ‘prot-dark-theme.el’ has a shared library which is ‘prot-themes.el’
and therein I find at least the following:

     ;; Package headers here for prot-themes.el...

     ;; Any other shared definitions...

     ;;;; Add themes from this package to the `custom-theme-load-path'

     ;;;###autoload
     (when load-file-name
       (let ((dir (file-name-directory load-file-name)))
           (add-to-list 'custom-theme-load-path dir)))

     (provide 'prot-themes)
     ;;; prot-themes.el ends here

   Then each individual theme can look like this (*note Complete example
of a custom theme with its own palette::):

     (require 'prot-themes)

     (modus-themes-theme
      'prot-light
      'prot-themes
      "My demo `prot-light' theme."
      'light
      'modus-operandi-palette
      nil
      nil)

   The contents of such a package will be of this form:

‘prot-themes.el’
     Common file with all the shared definitions.
‘prot-light-theme.el’
     The light theme.
‘prot-dark-theme.el’
     The dark theme.

   The shared file can be skipped if the only piece of common code is
the aforementioned snippet about the ‘custom-theme-load-path’.  Simply
add that snippet to the bottom of each theme file, like this:

     (modus-themes-theme
      'prot-light
      'prot-themes
      "My demo `prot-light' theme."
      'light
      'modus-operandi-palette
      nil
      nil)

     ;;;###autoload
     (when load-file-name
       (let ((dir (file-name-directory load-file-name)))
           (add-to-list 'custom-theme-load-path dir)))

   The package is then a collection of ‘NAME-theme.el’ files and nothing
more.

   In principle, a package derived from Modus does not need to define
any commands or user options.  What is shown in this section is enough.
Packages such as the ‘ef-themes’ and ‘standard-themes’ are exceptions
because they existed for years before they were based on Modus and must
remain backward compatible.

   *note Arrange to activate your derivative themes::.


File: modus-themes.info,  Node: Complete example of a private theme derived from Modus,  Next: Complete example of a custom theme with its own palette,  Prev: Complete example of a package that is derived from Modus,  Up: Complete example of a Modus derivative theme

9.1.2 Complete example of a private theme derived from Modus
------------------------------------------------------------

If your derivative theme is not going to be distributed as a package
(*note Complete example of a package that is derived from Modus::), then
create a directory where all custom themes are stored and add it to the
‘custom-theme-load-path’.  For example, the ‘my-custom-themes’ directory
can be included thus somewhere in the Emacs initialization file:

     (add-to-list 'custom-theme-load-path (locate-user-emacs-file "my-custom-themes/"))

   The function ‘locate-user-emacs-file’ takes care to return a path
relative to where the user's init file is.  If, say, I have
‘~/.emacs.d/init.el’ then I get ‘~/.emacs.d/my-custom-themes/’.

   Create the directory in that path.  Then for each derivative Modus
theme, write a new file of the form ‘NAME-theme.el’.  If, for instance,
your theme is named ‘prot-light’ the file is called
‘prot-light-theme.el’.

   At minimum, the contents of a theme file are these (*note Complete
example of a custom theme with its own palette::):

     (modus-themes-theme
      'prot-light
      'prot-themes
      "My demo `prot-light' theme."
      'light
      'modus-operandi-palette
      nil
      nil)

   *note Arrange to activate your derivative themes::.


File: modus-themes.info,  Node: Complete example of a custom theme with its own palette,  Next: Complete example that also uses modus-themes-generate-palette,  Prev: Complete example of a private theme derived from Modus,  Up: Complete example of a Modus derivative theme

9.1.3 Complete example of a custom theme with its own palette
-------------------------------------------------------------

It is a good idea for a derivative theme to use as its core palette one
of those defined in the ‘modus-themes’, such as
‘modus-operandi-palette’.  This guarantees that all core palette
definitions are inherited by the derivative theme.

   The derivative may then add its own colors to the user palette, which
will override the core palette in such of a conflict (*note Preview
theme colors::).

   The core and user palettes are among the arguments passed to the
‘modus-themes-theme’ functions, as explained elsewhere in this manual
(*note Build on top of the Modus themes::).

   In the following example, I am defining the ‘prot-light’ theme in the
‘prot-light-theme.el’ file.  This theme declares itself as belonging to
the ‘prot-themes’ family.  It is based on the ‘modus-operandi-palette’
but then defines its own palette, the ‘prot-light-palette’ with entries
that take precedence over whatever equivalent is in the
‘modus-operandi-palette’.

     (defvar prot-light-palette
       '((cursor "#ff0000")
         (bg-main "#f0e0d0")
         (fg-main "#202020"))
       "Like `modus-operandi-palette'.")

     (modus-themes-theme
      'prot-light
      'prot-themes
      "My demo `prot-light' theme."
      'light
      'modus-operandi-palette
      'prot-light-palette
      nil)

   The above is a complete theme which is like ‘modus-operandi’ except
for those three color definitions specified in the ‘prot-light-palette’.
There is no limit to how comprehensive the user palette is.

   Depending on the requirements, this theme can make itself further
customizable by the end user via theme-specific palette overrides.  In
this case, I have the addition of a user option, which I could call
anything though it makes sense to name it consistently like
‘prot-light-palette-overrides’.

     (defvar prot-light-palette
       '((cursor "#ff0000")
         (bg-main "#f0e0d0")
         (fg-main "#202020"))
       "Like `modus-operandi-palette'.")

     (defcustom prot-light-palette-overrides nil
       "Overrides for the `prot-light' theme."
       :type '(repeat (list symbol (choice symbol string)))
       :link '(info-link "(modus-themes) Palette overrides"))

     (modus-themes-theme
      'prot-light
      'prot-themes
      "My demo `prot-light' theme."
      'light
      'modus-operandi-palette
      'prot-light-palette
      'prot-light-palette-overrides)

   In the above example, I have my ‘prot-light’ theme which is like
‘modus-operandi’ except three colors and which can now be customized
further by the user via the ‘prot-light-palette-overrides’ (*note Option
for palette overrides: Palette overrides.).

   Finally, a derivative theme can specify its own settings for custom
faces and variables.  This is generally not needed, but is provided as
an option for maximum flexibility.  In the following example, the
‘prot-light’ theme has its own face definitions in addition to all the
aforementioned:

     (defvar prot-light-palette
       '((cursor "#ff0000")
         (bg-main "#f0e0d0")
         (fg-main "#202020"))
       "Like `modus-operandi-palette'.")

     (defcustom prot-light-palette-overrides nil
       "Overrides for the `prot-light' theme."
       :type '(repeat (list symbol (choice symbol string)))
       :link '(info-link "(modus-themes) Palette overrides"))

     (defvar prot-light-custom-faces
       '(
         `(region ((,c :background ,bg-ochre :foreground ,unspecified :extend nil)))
         `(font-lock-keyword-face ((,c :inherit italic :foreground ,keyword))))
       "Custom faces that deviate from---or complement---those in the Modus themes.")

     (modus-themes-theme
      'prot-light
      'prot-themes
      "My demo `prot-light' theme."
      'light
      'modus-operandi-palette
      'prot-light-palette
      'prot-light-palette-overrides
      'prot-light-custom-faces)

   The custom faces can name a color from the given theme's palette.  In
this example, ‘bg-ochre’ comes from the ‘modus-operandi-palette’ though
it would work the same way if, say, ‘prot-light-palette’ defined
‘bg-soil’ and then referenced it in ‘prot-light-custom-faces’.

   *note Arrange to activate your derivative themes::.


File: modus-themes.info,  Node: Complete example that also uses modus-themes-generate-palette,  Prev: Complete example of a custom theme with its own palette,  Up: Complete example of a Modus derivative theme

9.1.4 Complete example that also uses ‘modus-themes-generate-palette’
---------------------------------------------------------------------

The guide herein is of use to those who plan to create their own
derivative themes (*note Complete example of a private theme derived
from Modus::).

   The ‘modus-themes-generate-palette’ defines a fully flegded Modus
palette that can be passed to ‘modus-themes-theme’ without necessarily
depending on any of the core Modus palettes.  I will walk you through
the steps of working with something like the following code block.

   [ I use color values from Solarized as an example for the rest of
this entry, naming them according to my conventions.  ]

     (defvar modus-solarized-dark-palette
       (modus-themes-generate-palette
        '((bg-main "#073642")
          (fg-main "#EEE8D5")
          (red "#DC322F")
          (green "#859900")
          (yellow "#B58900")
          (blue "#268BD2")
          (magenta "#D33682")
          (cyan "#2AA198"))))

     (modus-themes-theme
      'modus-solarized-dark
      'modus-solarized-themes
      "Sample of a basic Solarized port."
      'dark
      'modus-solarized-dark-palette
      nil
      nil)

   The Modus themes define hundreds of entries in their palette.  Some
are named colors while others are semantic mappings (*note Option for
palette overrides: Palette overrides.).

   This gives users maximum control via overrides, though comes at the
considerable cost of making it harder to derive a custom palette from a
small set of colors.  Color schemes, which are not themes in the sense
of ensuring consistency across all elements and interfaces, will
typically provide 8 or 16 colors.  This is the case with terminal
emulators.  For example, the widely known Solarized theme, originally
designed by Ethan Schoonover, defines 16 colors for terminal emulators.
Nothing else.  Thus a hypothetical Modus+Solarized cannot work without
knowing how to complement the base with all the extra color definitions.

   This is where the function ‘modus-themes-generate-palette’ comes in.
In broad terms, it is meant to be used as a starting point.  The user
may then decide which results need further tweaking.  But at least they
will have something to create a fully fledged Modus palette right away.

   The minimum ‘modus-themes-generate-palette’ needs is a list of
‘BASE-COLORS’.  Each element is of the form ‘(NAME VALUE)’ where ‘NAME’
is a symbol and ‘VALUE’ is a string with a hexadecimal RGB color value
or a string with a name of a color among those listed in the output of
the command ‘list-colors-display’.

   The ‘BASE-COLORS’ can be as short as follows:

     ;; All missing palette entries will be derived automatically.  This
     ;; will return a COMPLETE Modus themes palette.
     (modus-themes-generate-palette
      '((bg-main "#073642")
        (fg-main "#EEE8D5")))

   The only two mandatory entries in ‘BASE-COLORS’ are ‘bg-main’ and
‘fg-main’ as shown above.  In this scenario, the derived palette will
get the job done, but will be very close to what Modus defines.  The
more I add to the ‘BASE-COLORS’, the more well defined the character of
the new palette will be.  For example:

     (modus-themes-generate-palette
      ;; The two base colors of Solarized, plus most of its accents.
      '((bg-main "#073642")
        (fg-main "#EEE8D5")
        (red "#DC322F")
        (green "#859900")
        (yellow "#B58900")
        (blue "#268BD2")
        (magenta "#D33682")
        (cyan "#2AA198")))

   This is already going to be a tolerable port of Solarized.  If the
‘BASE-COLORS’ provides ‘bg-main’, ‘fg-main’, and the six hues of ‘red’,
‘green’, ‘yellow’, ‘blue’, ‘magenta’, ‘cyan’, I will get a new palette
that has no trace of the color values implemented by core Modus.  Though
I can go further and greatly improve the results.

   The ‘modus-themes-generate-palette’ will internally calculate colors
based on what it receives.  Anything missing will be taken from a core
Modus palette, depending on the value of ‘bg-main’: if it is light, then
the ‘modus-themes-operandi-palette’ is used, otherwise it is
‘modus-themes-vivendi-palette’.  If all six of the aforementioned hues
are present, the ‘modus-themes-generate-palette’ will not calculate any
more color values.  It will use those to derive the relevant
permutations (e.g.  blue backgrounds from the ‘blue’ I give it).

   What also plays a role in the interal calculations is whether
‘bg-main’ is a ‘cool’ or ‘warm’ color, meaning whether it is closer to
blue or red, respectively.  Internally, ‘cool’ and ‘warm’ influence the
kind of color values and semantic mappings that will go into the new
palette.  To this end, the ‘modus-themes-generate-palette’ accepts an
optional parameter called ‘COOL-OR-WARM-PREFERENCE’.  This is a
preference for the symbol ‘cool’ or ‘warm’: it make the decision
explicit.

   For example, Solarized can swap the values of ‘bg-main’ and ‘fg-main’
to switch between its light and dark implementations (I understand this
is a smart trick for terminal emulators, but is otherwise not good
enough for thematic consistency as some accent values look out-of-place
and the contrasts vary considerably).  The light color Solarized uses is
inherently ‘warm’ (yellowish color means it is closer to red than blue)
while the dark color is ‘cool’, due to it being closer to pure blue.
Users may wish to experiment with a deviation from what would have been
the default output, such that the dark blue when used as a background
actually combines with warmer foreground hues, while the light cream
background goes together with cooler foreground values.  Thus:

     (modus-themes-generate-palette
      '((bg-main "#073642") ; normally this is a `cool' theme
        (fg-main "#EEE8D5")
        (red "#DC322F")
        (green "#859900")
        (yellow "#B58900")
        (blue "#268BD2")
        (magenta "#D33682")
        (cyan "#2AA198"))
      'warm) ; but I want to use it with `warm' foregrounds

     ;; And here is the inverse of the above, now with the light version of
     ;; Solarized.
     (modus-themes-generate-palette
      '((bg-main "#EEE8D5") ; normally this is a `warm' theme
        (fg-main "#073642")
        (red "#DC322F")
        (green "#859900")
        (yellow "#B58900")
        (blue "#268BD2")
        (magenta "#D33682")
        (cyan "#2AA198"))
      'cool) ; but I want to use it with `cool' foregrounds

   This is now getting better, but I can go further.  At this point
users should be able to do the common work of taking a color scheme that
was originally designed for terminal emulators and quickly turning it
into a fully fledged Modus palette.  All they need is to follow the
naming convention for ‘bg-main’, ‘fg-main’, and then
‘{red,green,yellow,blue,magenta,cyan}{,-warmer,-cooler}’.  Preview a
palette to get the complete list (*note Preview theme colors::).  And,
again, remember that not all colors need to be defined in ‘BASE-COLORS’
(e.g.  I could leave out ‘magenta-cooler’ if I do not care about it).

   The next optional parameter of ‘modus-themes-generate-palette’ is the
‘CORE-PALETTE’ it should use.  This is to make explicit the decision
that is otherwise handled internally on whether to fill in any missing
palette entries from Modus Operandi or Modus Vivendi (or their tinted
variants if ‘warm’ is the preference).

   The ‘CORE-PALETTE’ is the symbol of a variable whose value is a
palette, like ‘modus-themes-operandi-palette’.  Normally, users do not
need to ever set ‘CORE-PALETTE’.  The only two scenaria where this is
likely helpful is (i) the theme is optimized for red-green or
blue-yellow color deficiency, in which case one of the Modus palettes
for deuteranopia and tritanopia is needed, or (ii) the user wants to use
a palette from a Modus derivative theme, such as my ‘ef-themes’ and
‘standard-themes’.  In the latter scenario, users need to take care to
either copy the palette they want to use or, anyhow, ‘load’ the relevant
files.

   In the interest of clarity, here is how the ‘CORE-PALETTE’ is passed,
but, again, users probably should leave this to ‘nil’:

     (modus-themes-generate-palette
      ;; The two base colors of Solarized, plus all its accents.
      '((bg-main "#073642")
        (fg-main "#EEE8D5")
        (red "#DC322F")
        (green "#859900")
        (yellow "#B58900")
        (blue "#268BD2")
        (magenta "#D33682")
        (cyan "#2AA198"))
      nil ; COOL-OR-WARM-PREFERENCE is derived internally based on `bg-main'
      'modus-themes-vivendi-tritanopia-palette) ; I specifically want this as my CORE-PALETTE

   With core Modus palettes, the ‘CORE-PALETTE’ should not make much of
a difference.  Though a completely custom Modus derivative, like one of
the ‘ef-themes’, will be defining colors values that differ
substantially from those of core Modus, as well as completely different
semantic mappings.

   Finally, ‘modus-themes-generate-palette’ has an optional ‘MAPPINGS’
parameter.  This is a list of semantic mappings where each entry is of
the form ‘(NAME OTHER-NAME)’ (*note Option for palette overrides:
Palette overrides.).  The ‘NAME’ has the same meaning as for the
‘BASE-COLORS’ I have been examining all along, while ‘OTHER-NAME’ is the
symbol of another ‘NAME’ that exists in the palette, hence the mapping.
This manual contains lots of examples along those lines (*note DIY
Stylistic variants using palette overrides::).  For my purposes, I will
modify some of the obvious elements of the theme, namely, the cursor,
mode lines, current line highlight, matching parentheses, and active
region.

     (modus-themes-generate-palette
        '((bg-main "#073642")
          (fg-main "#EEE8D5")
          (red "#DC322F")
          (green "#859900")
          (yellow "#B58900")
          (blue "#268BD2")
          (magenta "#D33682")
          (cyan "#2AA198"))
        nil
        nil
        ;; And here are my MAPPINGS where I can specify what values apply
        ;; to which semantic color.  The `modus-themes-list-colors' shows
        ;; them all.
        ;;
        ;; Note that in my BASE-COLORS above I never wrote what, say,
        ;; `magenta-warmer' is: it is derived programmatically from the
        ;; `magenta' I have there.  Absent that, it would be taken from
        ;; the CORE-PALETTE.
        '((cursor magenta-warmer)
          (bg-hl-line bg-blue-nuanced)
          (bg-paren-match bg-magenta-subtle)
          (bg-region bg-blue-intense)
          (fg-region fg-dim)
          (bg-mode-line-active bg-blue-nuanced)
          (fg-mode-line-active blue-warmer)
          (border-mode-line-active blue-cooler)))

   The ‘MAPPINGS’ can be as long as the user needs.  Whatever is defined
here will take precedence of what the ‘CORE-PALETTE’ (or its internally
derived equivalent) provides.  At most, users can have a completely
custom palette.  Though I expect that this will not be done at the
outset, but only after a long process of experimentation (if you already
knew how to do this, ‘modus-themes-generate-palette’ would not be of
real value).  The point is to start with something that works and then
refine it one small step at a time.

   I am now ready to try my Solarized themes, using the example of doing
this in my private configuration (*note Complete example of a package
that is derived from Modus::).

   • Create two files, one is called ‘modus-solarized-dark-theme.el’ (or
     however you want to identify it, but always keep ‘-theme.el’ at the
     end) and the other is ‘modus-solarized-light-theme’.

   • Add their directory to the ‘custom-theme-load-path’, like
     ‘(add-to-list 'custom-theme-load-path
     "~/.emacs.d/custom-themes/")’.

   • Use the minimal code from the following two blocks to create your
     new themes.

   • Optionally activate ‘modus-themes-include-derivatives-mode’ to have
     all Modus commands recognize your themes.

   • Load your themes with ‘load-theme’.

   • Enjoy!

     ;; Modus+Solarized dark
     (defvar modus-solarized-dark-palette
       (modus-themes-generate-palette
        ;; I provide the two base colors of Solarized, plus most of its
        ;; accents.  These form the BASE-COLORS I pass as an argument.
        ;; All other color values come from those.  The BASE-COLORS here
        ;; are enough to generate a new palatte that has no traces of, say,
        ;; the `modus-vivendi' color values.
        '((bg-main "#073642")
          (fg-main "#EEE8D5")
          (red "#DC322F")
          (green "#859900")
          (yellow "#B58900")
          (blue "#268BD2")
          (magenta "#D33682")
          (cyan "#2AA198"))
        ;; The COOL-OR-WARM-PREFERENCE is derived internally based on
        ;; `bg-main'.  I can pass it here if I feel strongly about it.
        nil
        ;; If I need to specify the CORE-PALETTE from where to inherit any
        ;; missing colors and/or semantic mappings, I can give it here.
        ;; Though nil is the appropriate starting point, as the code will
        ;; handle things internally.
        nil
        ;; And here are my MAPPINGS where I can specify what values apply
        ;; to which semantic color.  The `modus-themes-list-colors' shows
        ;; them all.
        ;;
        ;; Note that in my BASE-COLORS above I never wrote what, say,
        ;; `magenta-warmer' is: it is derived programmatically from the
        ;; `magenta' I have there.  Absent that, it would be taken from
        ;; the CORE-PALETTE.
        '((cursor magenta-warmer)
          (bg-hl-line bg-blue-nuanced)
          (bg-paren-match bg-magenta-subtle)
          (bg-region bg-blue-intense)
          (fg-region fg-dim)
          (bg-mode-line-active bg-blue-nuanced)
          (fg-mode-line-active blue-warmer)
          (border-mode-line-active blue-cooler))))

     (modus-themes-theme
      'modus-solarized-dark
      'modus-solarized-themes
      "Sample of a basic Solarized dark port."
      'dark
      'modus-solarized-dark-palette
      nil
      nil)

   And the light variant:

     ;; Modus+Solarized light
     (defvar modus-solarized-light-palette
       (modus-themes-generate-palette
        ;; I provide the two base colors of Solarized, plus most of its
        ;; accents.  These form the BASE-COLORS I pass as an argument.
        ;; All other color values come from those.  The BASE-COLORS here
        ;; are enough to generate a new palatte that has no traces of, say,
        ;; the `modus-operandi' color values.
        '((bg-main "#EEE8D5")
          (fg-main "#073642")
          (red "#DC322F")
          (green "#859900")
          (yellow "#B58900")
          (blue "#268BD2")
          (magenta "#D33682")
          (cyan "#2AA198"))
        ;; The COOL-OR-WARM-PREFERENCE is derived internally based on
        ;; `bg-main'.  I can pass it here if I feel strongly about it.
        nil
        ;; If I need to specify the CORE-PALETTE from where to inherit any
        ;; missing colors and/or semantic mappings, I can give it here.
        ;; Though nil is the appropriate starting point, as the code will
        ;; handle things internally.
        nil
        ;; And here are my MAPPINGS where I can specify what values apply
        ;; to which semantic color.  The `modus-themes-list-colors' shows
        ;; them all.
        ;;
        ;; Note that in my BASE-COLORS above I never wrote what, say,
        ;; `magenta-warmer' is: it is derived programmatically from the
        ;; `magenta' I have there.  Absent that, it would be taken from
        ;; the CORE-PALETTE.
        '((cursor yellow-warmer)
          (bg-hl-line bg-red-nuanced)
          (bg-paren-match bg-green-subtle)
          (bg-region bg-blue-intense)
          (fg-region fg-dim)
          (bg-mode-line-active bg-yellow-subtle)
          (fg-mode-line-active yellow-cooler)
          (border-mode-line-active yellow-warmer))))

     (modus-themes-theme
      'modus-solarized-light
      'modus-solarized-themes
      "Sample of a basic Solarized light port."
      'light
      'modus-solarized-light-palette
      nil
      nil)

   *note Arrange to activate your derivative themes::.


File: modus-themes.info,  Node: Determine what counts as a Modus theme,  Next: Create convenience commands to load a derivative theme,  Prev: Complete example of a Modus derivative theme,  Up: Build on top of the Modus themes

9.2 Determine what counts as a Modus theme
==========================================

[ NOTE: Users of many Modus derivatives do not need to do anything of
what is described herein.  Just enable the
‘modus-themes-include-derivatives-mode’.  ]

   Once the theme is instantiated, it will be listed in the return value
of the function ‘modus-themes-get-all-known-themes’.  This function
accepts an optional argument to filter themes by their given family, as
specified at the time of the theme's reification (*note Build on top of
the Modus themes::).

   The generic function ‘modus-themes-get-themes’ is how
developers/users can affect what counts as a "Modus" theme.  By default,
‘modus-themes-get-themes’ essentially calls the following, to only
return the themes whose family is ‘modus-themes’:

     (modus-themes-get-all-known-themes 'modus-themes)

   A new method can be declared with ‘cl-defmethod’ to do something else
instead.  When exactly should that method come into effect is up to the
developer/user.  In the ‘ef-themes’, this is done via a minor mode, that
users must opt in to.  Here is the complete example:

     (define-minor-mode ef-themes-take-over-modus-themes-mode
       "When enabled, all Modus themes commands consider only Ef themes."
       :global t
       :init-value nil)

     (cl-defmethod modus-themes-get-themes (&context (ef-themes-take-over-modus-themes-mode (eql t)))
       (if-let* ((themes (modus-themes-get-all-known-themes 'ef-themes))
                 (sorted-themes (modus-themes-sort themes 'light)))
           sorted-themes
         ef-themes-items))

   The ‘define-minor-mode’ does not need to do anything else here.  Its
corresponding function simply takes care to toggle the variable of the
same name (i.e.  ‘ef-themes-take-over-modus-themes-mode’) between ‘nil’
and non-‘nil’.  The method will take effect when the minor mode is
enabled.  In this scenario, "Modus" themes are only those whose family
is ‘ef-themes’.  All the Modus commands that switch between themes will
thus only work with those Ef themes.

   For my part, I define the ‘modus-themes-include-derivatives-mode’.
It is how users can opt in to the all-inclusive conception of "Modus".
In this scenario, every theme that is declared with the aforementioned
‘modus-themes-theme’ will count as "Modus" and be available to all the
relevant commands for switching themes, previewing their palette, and so
on.

     (define-minor-mode modus-themes-include-derivatives-mode
       "When enabled, all Modus themes commands cover derivatives as well.
     Otherwise, they only consider the `modus-themes-items'.

     Derivative theme projects can implement the equivalent of this minor
     mode plus a method for `modus-themes-get-themes' to filter themes
     accordingly."
       :global t
       :init-value nil)

     (cl-defmethod modus-themes-get-themes (&context (modus-themes-include-derivatives-mode (eql t)))
       (if-let* ((themes (modus-themes-get-all-known-themes nil))
                 (sorted-themes (modus-themes-sort themes 'light)))
           sorted-themes
         modus-themes-items))


File: modus-themes.info,  Node: Create convenience commands to load a derivative theme,  Next: Arrange to activate your derivative themes,  Prev: Determine what counts as a Modus theme,  Up: Build on top of the Modus themes

9.3 Create convenience commands to load a derivative theme
==========================================================

[ NOTE: Users of many Modus derivatives do not need to do anything of
what is described herein.  Just enable the
‘modus-themes-include-derivatives-mode’.  ]

   In the previous section, I explored the mechanics of the
‘modus-themes-get-themes’ (*note Determine what counts as a Modus
theme::).  Independent of that method, developers can use the macro
‘modus-themes-define-derivative-command’ to define small wrappers for
Modus commands that load a theme only for a specific family of Modus
derivatives (*note Build on top of the Modus themes::).

   The ‘modus-themes-define-derivative-command’ takes two mandatory
arguments:

‘FAMILY’
     the family of the Modus themes derivatives, such as ‘ef-themes’.

‘SUFFIX’
     the suffix of the command-to-be-defined.  It is one among the
     symbols listed in
     ‘modus-themes-define-derivative-command-known-suffixes’.

   The suffix is appended to ‘FAMILY’ to derive the symbol of the
command.  For example, if ‘SUFFIX’ is ‘rotate’ and ‘FAMILY’ is
‘ef-themes’, then the symbol is ‘ef-themes-rotate’.

   Here is how it actually looks in the source code of the Ef themes:

     ;;;###autoload (autoload 'ef-themes-rotate "ef-themes")
     (modus-themes-define-derivative-command ef-themes rotate)

   This is what the macroexpanded form looks like:

     (defun ef-themes-rotate ()
       "Like `modus-themes-rotate' but only consider members of the `ef-themes'"
       (interactive)
       (cl-letf (((symbol-function 'modus-themes-get-themes)
                  (lambda () (modus-themes-get-all-known-themes 'ef-themes))))
         (call-interactively 'modus-themes-rotate)))

   Sometimes, it makes no sense to re-use an existing Modus command
(e.g.  because the developer wants to introduce a user option to affect
what the command is doing), though this approach with the ‘cl-letf’ can
still prove useful.


File: modus-themes.info,  Node: Arrange to activate your derivative themes,  Prev: Create convenience commands to load a derivative theme,  Up: Build on top of the Modus themes

9.4 Arrange to activate your derivative themes
==============================================

The ‘modus-themes-theme’ function is responsible for instantiating a
theme and registering it for use by the various Modus commands that act
on a theme (*note Build on top of the Modus themes::).  Due to how Emacs
themes are designed to be bound to files, ‘modus-themes-theme’ can only
work if the given theme file is already loaded.  Otherwise my function
is never called and the theme is never created.

   To this end, users need to call the function ‘modus-themes-activate’
with each theme they want as an argument.  Remember that themes are
files with a ‘-theme.el’ suffix inside one of the directories listed in
the value of the variable ‘custom-theme-load-path’.  In its simplest
form, the activation looks as follows, assuming the theme's file
‘modus-solarized-dark-theme.el’ exists:

     (modus-themes-activate 'modus-solarized-dark)

   To load multiple themes at once I can define a function like the
following:

     (defun my-modus-derivatives-activate-themes (directory)
       "Activate all themes in DIRECTORY.
     This makes all Modus derivatives available to commands such as
     `modus-themes-select' if `modus-themes-include-derivatives-mode' is
     enabled."
       (let* ((files (directory-files directory :full-path "-theme\\.el"))
              (names (mapcar
                      (lambda (file)
                        (intern (replace-regexp-in-string "-theme\\.el" "" file)))
                      files)))
         (mapc #'modus-themes-activate names)))

   Then call it thus:

     (my-modus-derivatives-activate-themes "/path/to/my/custom/theme/directory/")

   Again, remember that the directory is in the
‘custom-theme-load-path’:

     (add-to-list 'custom-theme-load-path "/path/to/my/custom/theme/directory/")


File: modus-themes.info,  Node: Face coverage,  Next: Notes on individual packages,  Prev: Build on top of the Modus themes,  Up: Top

10 Face coverage
****************

The Modus themes try to provide as close to full face coverage as
possible.  This is necessary to ensure a consistently accessible reading
experience across all available interfaces.

* Menu:

* Supported packages::           Full list of covered face groups
* Indirectly covered packages::


File: modus-themes.info,  Node: Supported packages,  Next: Indirectly covered packages,  Up: Face coverage

10.1 Full support for packages or face groups
=============================================

This list will always be updated to reflect the current state of the
project.  The idea is to offer an overview of the known status of all
affected face groups.  The items with an appended asterisk ‘*’ tend to
have lots of extensions, so the "full support" may not be 100% true…

   • abbrev
   • ace-window
   • all-the-icons
   • all-the-icons-dired
   • all-the-icons-ibuffer
   • annotate
   • ansi-color
   • anzu
   • auctex and TeX
   • auto-dim-other-buffers
   • avy
   • bbdb
   • binder
   • breadcrumb
   • bongo
   • boon
   • bookmark
   • calendar and diary
   • centaur-tabs
   • change-log and log-view (such as ‘vc-print-log’,
     ‘vc-print-root-log’)
   • chart
   • cider
   • circe
   • citar
   • clojure-mode
   • column-enforce-mode
   • company-mode*
   • compilation-mode
   • completion-preview
   • completions
   • consult
   • corfu
   • corfu-candidate-overlay
   • corfu-quick
   • counsel*
   • cperl-mode
   • crontab-mode
   • csv-mode
   • ctrlf
   • custom (what you get with ‘M-x customize’)
   • dashboard
   • deadgrep
   • debbugs
   • deft
   • denote
   • devdocs
   • dictionary
   • diff-hl
   • diff-mode
   • dim-autoload
   • dired
   • dired-async
   • dired-git
   • dired-git-info
   • dired-narrow
   • dired-subtree
   • diredfl
   • disk-usage
   • display-fill-column-indicator-mode
   • doom-modeline
   • ediff
   • ein (Emacs IPython Notebook)
   • eglot
   • el-search
   • eldoc-box
   • elfeed
   • elfeed-score
   • elisp (Emacs Lisp semantic highlighting)
   • elpher
   • embark
   • ement
   • emms
   • epa
   • erc
   • ert
   • erts-mode
   • eshell
   • eshell-fringe-status
   • evil* (evil-mode)
   • eww
   • exwm
   • eyebrowse
   • flycheck
   • flycheck-color-mode-line
   • flycheck-indicator
   • flymake
   • flyspell
   • flx
   • focus
   • fold-this
   • font-lock (generic syntax highlighting)
   • forge
   • geiser
   • git-commit
   • git-gutter (and variants)
   • git-rebase
   • git-timemachine
   • gnus
   • gotest
   • golden-ratio-scroll-screen
   • helpful
   • hexl-mode
   • hideshow
   • highlight-numbers
   • highlight-parentheses (*note Note on highlight-parentheses.el: Note
     on highlight-parenthesesel.)
   • highlight-thing
   • hl-fill-column
   • hl-line-mode
   • hl-todo
   • howm
   • hydra
   • ibuffer
   • icomplete
   • ido-mode
   • iedit
   • iflipb
   • image-dired
   • imenu-list
   • info
   • info+ (info-plus)
   • info-colors
   • institution-calendar
   • ioccur
   • isearch, occur, etc.
   • ivy*
   • ivy-posframe
   • jabber
   • japanese-holidays
   • jira (org-jira)
   • jit-spell
   • jinx
   • journalctl-mode
   • js2-mode
   • julia
   • kaocha-runner
   • keycast
   • kmacro-menu
   • ledger-mode
   • leerzeichen
   • lin
   • line numbers (‘display-line-numbers-mode’ and global variant)
   • magit
   • make-mode
   • man
   • marginalia
   • markdown-mode
   • markdown-ts-mode
   • markup-faces (‘adoc-mode’)
   • mb-depth
   • mct
   • messages
   • minimap
   • mode-line
   • mood-line
   • mpdel
   • mu4e
   • multiple-cursors
   • nerd-icons
   • nerd-icons-completion
   • nerd-icons-dired
   • nerd-icons-ibuffer
   • neotree
   • notmuch
   • num3-mode
   • nxml-mode
   • olivetti
   • orderless
   • org*
   • org-journal
   • org-noter
   • org-pomodoro
   • org-recur
   • org-roam
   • org-superstar
   • org-table-sticky-header
   • org-tree-slide
   • origami
   • outline-mode
   • outline-minor-faces
   • package (what you get with ‘M-x list-packages’)
   • page-break-lines
   • pandoc-mode
   • paren-face
   • pass
   • pdf-tools
   • persp-mode
   • perspective
   • popup
   • powerline
   • prism (*note Note for prism.el: Note for prism.)
   • prescient
   • proced
   • prodigy
   • pulsar
   • pulse
   • pyim
   • quick-peek
   • rainbow-delimiters
   • rcirc
   • rcirc-color
   • recursion-indicator
   • regexp-builder (also known as ‘re-builder’)
   • rg (rg.el)
   • ripgrep
   • rmail
   • rst-mode
   • ruler-mode
   • sesman
   • shell-script-mode
   • shortdoc
   • show-paren-mode
   • shr
   • side-notes
   • sieve-mode
   • skewer-mode
   • slime (slbd)
   • sly
   • smart-mode-line
   • smerge
   • spacious-padding
   • speedbar
   • spell-fu
   • stripes
   • suggest
   • switch-window
   • swiper
   • symbol-overlay
   • synaxis [Part of 5.4.0-dev]
   • syslog-mode
   • tab-bar-mode
   • tab-line-mode
   • table (built-in ‘table.el’)
   • telega
   • terraform-mode
   • term
   • textsec
   • tldr
   • tmr
   • transient (pop-up windows such as Magit's)
   • trashed
   • treemacs
   • tree-sitter
   • trust-manager
   • tty-menu
   • tuareg
   • typescript
   • typst
   • undo-tree
   • vc (‘vc-dir.el’, ‘vc-hooks.el’)
   • vertico
   • vertico-quick
   • vimish-fold
   • viper
   • visible-mark
   • visual-regexp
   • vtable
   • vterm
   • vundo
   • wcheck-mode
   • web-mode
   • wgrep
   • which-function-mode
   • which-key
   • whitespace-mode
   • window-divider-mode
   • window-tool-bar
   • writegood-mode
   • woman
   • xah-elisp-mode
   • xterm-color (and ansi-colors)
   • yaml-mode
   • yasnippet
   • ztree

   Plus many other miscellaneous faces that are provided by Emacs.


File: modus-themes.info,  Node: Indirectly covered packages,  Prev: Supported packages,  Up: Face coverage

10.2 Indirectly covered packages
================================

These do not require any extra styles because they are configured to
inherit from some basic faces or their dependencies which are directly
supported by the themes.

   • ag
   • apropos
   • apt-sources-list
   • bbdb
   • bm
   • breakpoint (provided by the built-in ‘gdb-mi.el’ library)
   • buffer-expose
   • bufler
   • counsel-notmuch
   • counsel-org-capture-string
   • css-mode
   • dashboard (emacs-dashboard)
   • define-word
   • denote
   • disk-usage
   • dtache
   • dynamic-ruler
   • easy-kill
   • ebdb
   • edit-indirect
   • egerrit
   • elfeed-summary
   • evil-owl
   • flyspell-correct
   • fortran-mode
   • freeze-it
   • git-walktree
   • goggles
   • highlight-defined
   • highlight-escape-sequences (‘hes-mode’)
   • icomplete-vertical
   • i3wm-config-mode
   • lin
   • minibuffer-line
   • no-emoji
   • org-remark
   • parrot
   • perl-mode
   • php-mode
   • pulsar
   • rjsx-mode
   • side-hustle
   • spell-fu
   • swift-mode
   • tab-bar-echo-area
   • tide
   • undo-hl
   • vdiff
   • vertico-indexed
   • vertico-mouse
   • xref


File: modus-themes.info,  Node: Notes on individual packages,  Next: Frequently Asked Questions,  Prev: Face coverage,  Up: Top

11 Notes on individual packages
*******************************

This section covers information that may be of interest to users of
individual packages.

* Menu:

* Note on calendar.el weekday and weekend colors: Note on calendarel weekday and weekend colors.
* Note on git-gutter in Doom Emacs::
* Note on php-mode multiline comments::
* Note on underlines in compilation buffers::
* Note on inline Latex in Org buffers::
* Note on dimmer.el: Note on dimmerel.
* Note on display-fill-column-indicator-mode::
* Note on highlight-parentheses.el: Note on highlight-parenthesesel.
* Note on mmm-mode.el background colors: Note on mmm-modeel background colors.
* Note for prism::
* Note on company-mode overlay pop-up::
* Note on ERC escaped color sequences::
* Note on powerline or spaceline::
* Note on SHR colors::
* Note on SHR fonts::
* Note on Ement colors and fonts::
* Note on pdf-tools link hints::
* Note on the Notmuch logo::
* Note on goto-address-mode faces::


File: modus-themes.info,  Node: Note on calendarel weekday and weekend colors,  Next: Note on git-gutter in Doom Emacs,  Up: Notes on individual packages

11.1 Note on calendar.el weekday and weekend colors
===================================================

By default, the ‘M-x calendar’ interface differentiates weekdays from
weekends by applying a gray color to the former and a faint red to the
latter.  The idea for this approach is that the weekend should serve as
a subtle warning that no work is supposed to be done on that day, per
the design of traditional calendars.

   Users who prefer all days to look the same can configure the variable
‘calendar-weekend-days’ to either use gray of weekdays or the faint red
of weekends uniformly.

     ;; All are treated like weekdays (gray color)
     (setq calendar-weekend-days nil)

     ;; All are treated like weekends (red-faint color)
     (setq calendar-weekend-days (number-sequence 0 6))

     ;; The default marks the Saturday and Sunday as the weekend
     (setq calendar-weekend-days '(0 6))

   For changes to take effect, the Calendar buffer needs to be generated
anew.


File: modus-themes.info,  Node: Note on git-gutter in Doom Emacs,  Next: Note on php-mode multiline comments,  Prev: Note on calendarel weekday and weekend colors,  Up: Notes on individual packages

11.2 Note on git-gutter in Doom Emacs
=====================================

The ‘git-gutter’ and ‘git-gutter-fr’ packages default to drawing bitmaps
for the indicators they display (e.g.  bitmap of a plus sign for added
lines).  In Doom Emacs, these bitmaps are replaced with contiguous lines
which may look nicer, but require a change to the foreground of the
relevant faces to yield the desired color combinations.

   Since this is Doom-specific, I urge users to apply changes in their
local setup.  Below is some sample code, based on what I cover at length
elsewhere in this manual:

   *note Advanced customization::.

   *note Use theme colors in code with modus-themes-with-colors: Use
theme colors in code with modus-themes-with-colors.

     (defun my-modus-themes-custom-faces (&rest _)
       (modus-themes-with-colors
         (custom-set-faces
          ;; Make foreground the same as background for a uniform bar on
          ;; Doom Emacs.
          ;;
          ;; Doom should not be implementing such hacks because themes
          ;; cannot support them:
          ;; <https://protesilaos.com/codelog/2022-08-04-doom-git-gutter-modus-themes/>.
          `(git-gutter-fr:added ((,c :foreground ,bg-added-fringe)))
          `(git-gutter-fr:deleted ((,c :foreground ,bg-removed-fringe)))
          `(git-gutter-fr:modified ((,c :foreground ,bg-changed-fringe))))))

     (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces)

   *note Using a hook at the post-load-theme phase: DIY Use a hook at
the post-load-theme phase.

   As always, re-load the theme for changes to take effect.

   If the above does not work, try this instead:

     (after! modus-themes
       (modus-themes-with-colors
         (custom-set-faces
          ;; Make foreground the same as background for a uniform bar on
          ;; Doom Emacs.
          ;;
          ;; Doom should not be implementing such hacks because themes
          ;; cannot support them:
          ;; <https://protesilaos.com/codelog/2022-08-04-doom-git-gutter-modus-themes/>.
          `(git-gutter-fr:added ((,c :foreground ,bg-added-intense)))
          `(git-gutter-fr:deleted ((,c :foreground ,bg-removed-intense)))
          `(git-gutter-fr:modified ((,c :foreground ,bg-changed-intense))))))


File: modus-themes.info,  Node: Note on php-mode multiline comments,  Next: Note on underlines in compilation buffers,  Prev: Note on git-gutter in Doom Emacs,  Up: Notes on individual packages

11.3 Note on php-mode multiline comments
========================================

Depending on your build of Emacs and/or the environment it runs in,
multiline comments in PHP with the ‘php-mode’ package use the
‘font-lock-doc-face’ instead of ‘font-lock-comment-face’.

   This seems to make all comments use the appropriate face:

     (defun my-multine-comments (&rest _)
       (setq-local c-doc-face-name 'font-lock-comment-face))

     (add-hook 'php-mode-hook #'my-multine-comments)

   As always, re-load the theme for changes to take effect.


File: modus-themes.info,  Node: Note on underlines in compilation buffers,  Next: Note on inline Latex in Org buffers,  Prev: Note on php-mode multiline comments,  Up: Notes on individual packages

11.4 Note on underlines in compilation buffers
==============================================

Various buffers that produce compilation results or run tests on code
apply an underline to the file names they reference or to relevant
messages.  Users may consider this unnecessary or excessive.

   To outright disable the effect, use this (buffers need to be
generated anew):

     (setq compilation-message-face nil)

   If some element of differentiation is still desired, a good option is
to render the affected text with the ‘italic’ face:

     (setq compilation-message-face 'italic)

   *note Configure bold and italic faces: DIY Configure bold and italic
faces.


File: modus-themes.info,  Node: Note on inline Latex in Org buffers,  Next: Note on dimmerel,  Prev: Note on underlines in compilation buffers,  Up: Notes on individual packages

11.5 Note on inline Latex in Org buffers
========================================

Org can work with inline latex and related syntax.  To actually fontify
those constructs, set the variable ‘org-highlight-latex-and-related’ to
the desired list of values (per its docstring).  For example:

     (setq org-highlight-latex-and-related '(latex script))

   Remember to use ‘M-x org-mode-restart’ for changes to take effect.


File: modus-themes.info,  Node: Note on dimmerel,  Next: Note on display-fill-column-indicator-mode,  Prev: Note on inline Latex in Org buffers,  Up: Notes on individual packages

11.6 Note on dimmer.el
======================

The ‘dimmer.el’ library by Neil Okamoto can be configured to
automatically dim the colors of inactive Emacs windows.  To guarantee
consistent results with the Modus themes, I suggest some tweaks to the
default styles, such as in this minimal setup:

     (use-package dimmer
       :config
       (setq dimmer-fraction 0.3)
       (setq dimmer-adjustment-mode :foreground)
       (setq dimmer-use-colorspace :rgb)

       (dimmer-mode 1))

   Of the above, I strongly recommend the RGB color space because it is
the one that remains faithful to the hueness of the colors used by the
themes.  Whereas the default CIELAB space has a tendency to distort
colors in addition to applying the dim effect, which can be somewhat
disorienting.

   The value of the ‘dimmer-fraction’ has been selected empirically.
Users might prefer to tweak it further (increasing it makes the dim
effect more pronounced).

   Changing the ‘dimmer-adjustment-mode’ is a matter of preference.
Though because the Modus themes use black and white as their base
colors, any other value for that variable will turn the main background
gray.  This inadvertently leads to the opposite of the intended utility
of this package: it draws too much attention to unfocused windows.


File: modus-themes.info,  Node: Note on display-fill-column-indicator-mode,  Next: Note on highlight-parenthesesel,  Prev: Note on dimmerel,  Up: Notes on individual packages

11.7 Note on display-fill-column-indicator-mode
===============================================

The ‘display-fill-column-indicator-mode’ uses a typographic character to
draw its line.  This has the downside of creating a dashed line.  The
dashes are further apart depending on how tall the font's glyph height
is and what integer the ‘line-spacing’ is set to.

   At the theme level I eliminate this effect by making the character
one pixel tall: the line is contiguous.  Users who prefer the dashed
line are advised to change the ‘fill-column-indicator’ face, as
explained elsewhere in this document.  For example:

     (modus-themes-with-colors
       (custom-set-faces
        `(fill-column-indicator ((,c :foreground ,bg-active)))))

   *note Use theme colors in code with modus-themes-with-colors: Use
theme colors in code with modus-themes-with-colors.

   To make the line thicker, set the height to be equal to the base font
size instead of the one pixel I use.  This is done by specifying a rate
instead of an absolute number, as in ‘:height 1.0’ versus ‘:height 1’.
For example:

     (modus-themes-with-colors
       (custom-set-faces
        `(fill-column-indicator ((,c :height 1.0 :background ,bg-inactive :foreground ,bg-inactive)))))


File: modus-themes.info,  Node: Note on highlight-parenthesesel,  Next: Note on mmm-modeel background colors,  Prev: Note on display-fill-column-indicator-mode,  Up: Notes on individual packages

11.8 Note on highlight-parentheses.el
=====================================

The ‘highlight-parentheses’ package provides contextual coloration of
surrounding parentheses, highlighting only those which are around the
point.  The package expects users to customize the applicable colors on
their own by configuring certain variables.

   To make the Modus themes work as expected with this, I need to use
some of the techniques that are discussed at length in the various
"Do-It-Yourself" (DIY) sections, which provide insight into the more
advanced customization options of the themes.

   *note Advanced customization::.

   In the following example, I am assuming that the user wants to (i)
reuse color variables provided by the themes, (ii) be able to retain
their tweaks while switching between ‘modus-operandi’ and
‘modus-vivendi’, and (iii) have the option to highlight either the
foreground of the parentheses or the background as well.

   I start by defining my own variable, which will serve as a toggle
between foreground and background coloration styles:

     (defvar my-highlight-parentheses-use-background t
       "Prefer `highlight-parentheses-background-colors'.")

   Then I can update my preference with this:

     ;; Set to nil to disable backgrounds.
     (setq my-highlight-parentheses-use-background nil)

   To reuse colors from the themes, I must wrap my code in the
‘modus-themes-with-colors’ macro.  My implementation must interface with
the variables ‘highlight-parentheses-background-colors’ and/or
‘highlight-parentheses-colors’.

   So I can have something like this (the docstring of
‘modus-themes-with-colors’ explains where the names of the colors can be
found):

     (modus-themes-with-colors
         ;; My preference for setting either background or foreground
         ;; styles, depending on `my-highlight-parentheses-use-background'.
         (if my-highlight-parentheses-use-background

             ;; Here I set color combinations that involve both a background
             ;; and a foreground value.
             (setq highlight-parentheses-background-colors (list bg-cyan-intense
                                                                 bg-magenta-intense
                                                                 bg-green-intense
                                                                 bg-yellow-intense)
                   highlight-parentheses-colors (list cyan
                                                      magenta
                                                      green
                                                      yellow))

           ;; And here I pass only foreground colors while disabling any
           ;; backgrounds.
           (setq highlight-parentheses-colors (list green-intense
                                                    magenta-intense
                                                    blue-intense
                                                    red-intense)
                 highlight-parentheses-background-colors nil)))

     ;; Include this if you also want to make the parentheses bold:
     (set-face-attribute 'highlight-parentheses-highlight nil :inherit 'bold)

     ;; My changes must be evaluated before enabling the relevant mode, so
     ;; this comes last.
     (global-highlight-parentheses-mode 1)

   For my changes to persist while switching between the Modus themes, I
need to include them in a function which can then get passed to
‘modus-themes-after-load-theme-hook’.  This is the complete
implementation:

     ;; Configurations for `highlight-parentheses':
     (require 'highlight-parentheses)

     (defvar my-highlight-parentheses-use-background t
       "Prefer `highlight-parentheses-background-colors'.")

     (setq my-highlight-parentheses-use-background nil) ; Set to nil to disable backgrounds

     (defun my-modus-themes-highlight-parentheses (&rest _)
       (modus-themes-with-colors
         ;; My preference for setting either background or foreground
         ;; styles, depending on `my-highlight-parentheses-use-background'.
         (if my-highlight-parentheses-use-background

             ;; Here I set color combinations that involve both a background
             ;; and a foreground value.
             (setq highlight-parentheses-background-colors (list bg-cyan-intense
                                                                 bg-magenta-intense
                                                                 bg-green-intense
                                                                 bg-yellow-intense)
                   highlight-parentheses-colors (list cyan
                                                      magenta
                                                      green
                                                      yellow))

           ;; And here I pass only foreground colors while disabling any
           ;; backgrounds.
           (setq highlight-parentheses-colors (list green-intense
                                                    magenta-intense
                                                    blue-intense
                                                    red-intense)
                 highlight-parentheses-background-colors nil)))

       ;; Include this if you also want to make the parentheses bold:
       (set-face-attribute 'highlight-parentheses-highlight nil :inherit 'bold)

       ;; My changes must be evaluated before enabling the relevant mode, so
       ;; this comes last.
       (global-highlight-parentheses-mode 1))

     (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-highlight-parentheses)

   *note Using a hook at the post-load-theme phase: DIY Use a hook at
the post-load-theme phase.

   As always, re-load the theme for changes to take effect.


File: modus-themes.info,  Node: Note on mmm-modeel background colors,  Next: Note for prism,  Prev: Note on highlight-parenthesesel,  Up: Notes on individual packages

11.9 Note on mmm-mode.el background colors
==========================================

The faces used by ‘mmm-mode.el’ are expected to have a colorful
background, while they should not touch any foreground value.  The idea
is that they must not interfere with existing fontification.  Those
background colors need to be distinct from each other, such as an
unambiguous red juxtaposed with a clear blue.

   While this design may be internally consistent with the raison d'être
of that library, it inevitably produces inaccessible color combinations.

   There are two competing goals at play:

  1. Legibility of the text, understood as the contrast ratio between
     the background and the foreground.

  2. Semantic precision of each face which entails faithfulness to
     color-coding of the underlying background.

   As the Modus themes are designed with the express purpose of
conforming with the first point, I have to forgo the apparent
color-coding of the background elements.  Instead I use subtle colors
that do not undermine the legibility of the affected text while they
still offer a sense of added context.

   Users who might prefer to fall below the minimum 7:1 contrast ratio
in relative luminance (the accessibility target I conform with), can opt
to configure the relevant faces on their own.

   *note Use theme colors in code with modus-themes-with-colors: Use
theme colors in code with modus-themes-with-colors.

   This example uses more vivid background colors, though it comes at
the very high cost of degraded legibility.

     (modus-themes-with-colors
       (custom-set-faces
        `(mmm-cleanup-submode-face ((,c :background ,bg-yellow-intense)))
        `(mmm-code-submode-face ((,c :background ,bg-inactive)))
        `(mmm-comment-submode-face ((,c :background ,bg-blue-intense)))
        `(mmm-declaration-submode-face ((,c :background ,bg-cyan-intense)))
        `(mmm-default-submode-face ((,c :background ,bg-dim)))
        `(mmm-init-submode-face ((,c :background ,bg-magenta-intense)))
        `(mmm-output-submode-face ((,c :background ,bg-red-intense)))
        `(mmm-special-submode-face ((,c :background ,bg-green-intense)))))


File: modus-themes.info,  Node: Note for prism,  Next: Note on company-mode overlay pop-up,  Prev: Note on mmm-modeel background colors,  Up: Notes on individual packages

11.10 Note on prism.el
======================

This package by Adam Porter, aka "alphapapa" or "github-alphapapa",
implements an alternative to the typical coloration of code.  Instead of
highlighting the syntactic constructs, it applies color to different
levels of depth in the code structure.

   As ‘prism.el’ offers a broad range of customizations, I cannot style
it directly at the theme level: that would run contrary to the spirit of
the package.  Instead, I may offer preset color schemes.  Those should
offer a starting point for users to adapt to their needs.

   In the following code snippets, I employ the
‘modus-themes-with-colors’ macro: *note Use theme colors in code with
modus-themes-with-colors: Use theme colors in code with
modus-themes-with-colors.

   These are the minimum recommended settings with 16 colors:

     (setq prism-num-faces 16)

     (prism-set-colors
       :desaturations '(0) ; do not change---may lower the contrast ratio
       :lightens '(0)      ; same
       :colors (modus-themes-with-colors
                 (list fg-main
                       magenta
                       cyan-cooler
                       magenta-cooler
                       blue
                       magenta-warmer
                       cyan-warmer
                       red-cooler
                       green
                       fg-main
                       cyan
                       yellow
                       blue-warmer
                       red-warmer
                       green-cooler
                       yellow-faint)))

   With 8 colors:

     (setq prism-num-faces 8)

     (prism-set-colors
       :desaturations '(0) ; do not change---may lower the contrast ratio
       :lightens '(0)      ; same
       :colors (modus-themes-with-colors
                 (list blue
                       magenta
                       magenta-cooler
                       cyan-cooler
                       fg-main
                       blue-warmer
                       red-cooler
                       cyan)))

   And this is with 4 colors, which produces results that are the
closest to the themes' default aesthetic:

     (setq prism-num-faces 4)

     (prism-set-colors
       :desaturations '(0) ; do not change---may lower the contrast ratio
       :lightens '(0)      ; same
       :colors (modus-themes-with-colors
                 (list blue
                       magenta
                       magenta-cooler
                       green-warmer)))

   If you need to apply desaturation and lightening, you can use what
the ‘prism.el’ documentation recommends, like this (adapting to the
examples with the 4, 8, 16 colors):

     (prism-set-colors
       :desaturations (cl-loop for i from 0 below 16 collect (* i 2.5))
       :lightens (cl-loop for i from 0 below 16 collect (* i 2.5))
       :colors (modus-themes-with-colors
                 (list fg-main
                       cyan-cooler
                       magenta-cooler
                       magenta)))


File: modus-themes.info,  Node: Note on company-mode overlay pop-up,  Next: Note on ERC escaped color sequences,  Prev: Note for prism,  Up: Notes on individual packages

11.11 Note on company-mode overlay pop-up
=========================================

By default, the ‘company-mode’ pop-up that lists completion candidates
is drawn using an overlay.  This creates alignment issues every time it
is placed above a piece of text that has a different height than the
default.

   The solution recommended by the project's maintainer is to use an
alternative front-end for drawing the pop-up which draws child frames
instead of overlays.(1)(2)

   Also consider the ‘corfu’ package.

   ---------- Footnotes ----------

   (1) <https://github.com/company-mode/company-mode/issues/1010>

   (2) <https://github.com/tumashu/company-posframe/>


File: modus-themes.info,  Node: Note on ERC escaped color sequences,  Next: Note on powerline or spaceline,  Prev: Note on company-mode overlay pop-up,  Up: Notes on individual packages

11.12 Note on ERC escaped color sequences
=========================================

The built-in IRC client ‘erc’ has the ability to colorize any text using
escape sequences that start with ‘^C’ (inserted with ‘C-q C-c’) and are
followed by a number for the foreground and background.(1)  Possible
numbers are 0-15, with the first entry being the foreground and the
second the background, separated by a comma.  Like this ‘^C1,6’.  The
minimum setup is this:

     (add-to-list 'erc-modules 'irccontrols)
     (setq erc-interpret-controls-p t
           erc-interpret-mirc-color t)

   As this allows users the chance to make arbitrary combinations, it is
impossible to guarantee a consistently high contrast ratio.  All I can I
do is provide guidance on the combinations that satisfy the
accessibility standard of the themes:

Modus Operandi
     Use foreground color 1 for all backgrounds from 2-15.  Like so:
     ‘C-q C-c1’ where ‘N’ is the background.

Modus Vivendi
     Use foreground color 0 for all backgrounds from 2-13.  Use
     foreground ‘1’ for backgrounds 14, 15.

   Colors 0 and 1 are white and black respectively.  So combine them
together, if you must.

   ---------- Footnotes ----------

   (1) This page explains the basics, though it is not specific to
Emacs: <https://www.mirc.com/colors.html>


File: modus-themes.info,  Node: Note on powerline or spaceline,  Next: Note on SHR colors,  Prev: Note on ERC escaped color sequences,  Up: Notes on individual packages

11.13 Note on powerline or spaceline
====================================

Both Powerline and Spaceline package users will likely need to use the
command ‘powerline-reset’ whenever they make changes to their themes
and/or mode line setup.


File: modus-themes.info,  Node: Note on SHR colors,  Next: Note on SHR fonts,  Prev: Note on powerline or spaceline,  Up: Notes on individual packages

11.14 Note on SHR colors
========================

Emacs' HTML rendering library (‘shr.el’) may need explicit configuration
to respect the theme's colors instead of whatever specifications the
webpage provides.

   Consult the docstring of ‘shr-use-colors’.


File: modus-themes.info,  Node: Note on SHR fonts,  Next: Note on Ement colors and fonts,  Prev: Note on SHR colors,  Up: Notes on individual packages

11.15 Note on SHR fonts
=======================

By default, packages that build on top of the Simple HTML Renderer
(‘shr’) use proportionately spaced fonts.  This is controlled by the
user option ‘shr-use-fonts’, which is set to non-‘nil’ by default.  To
use the standard font instead, set that variable to ‘nil’.

   *note Font configurations for Org and others: DIY Font configurations
for Org and others.

   Packages affected by this are:

   • elfeed
   • ement
   • eww

   This is a non-exhaustive list.


File: modus-themes.info,  Node: Note on Ement colors and fonts,  Next: Note on pdf-tools link hints,  Prev: Note on SHR fonts,  Up: Notes on individual packages

11.16 Note on Ement colors and fonts
====================================

The ‘ement.el’ library by Adam Porter (also known as "alphapapa")
defaults to a method of colorizing usernames in a rainbow style.  This
is controlled by the user option ‘ement-room-prism’ and can be disabled
with:

     (setq ement-room-prism nil)

   The contrast ratio of these colors is governed by another user
option: ‘ement-room-prism-minimum-contrast’.  By default, it is set to 6
which is slightly below my nominal target.  Try this instead:

     (setq ement-room-prism-minimum-contrast 7)

   With regard to fonts, Ement depends on ‘shr’ (*note Note on SHR
fonts::).

   Since I am here, here is an excerpt from Ement's source code:

     (defcustom ement-room-prism-minimum-contrast 6
       "Attempt to enforce this minimum contrast ratio for user faces.
     This should be a reasonable number from, e.g. 0-7 or so."
       ;; Prot would almost approve of this default.  :) I would go all the way
       ;; to 7, but 6 already significantly dilutes the colors in some cases.
       :type 'number)

   Yes, I do approve of that default.  Even a 4.5 (the WCAG AA rating)
would be a good baseline for many themes and/or user configurations.  My
target is the highest of the sort, though I do not demand that everyone
conforms with it.


File: modus-themes.info,  Node: Note on pdf-tools link hints,  Next: Note on the Notmuch logo,  Prev: Note on Ement colors and fonts,  Up: Notes on individual packages

11.17 Note on pdf-tools link hints
==================================

Hints are drawn by ImageMagick (https://imagemagick.org/), not Emacs,
i.e., ImageMagick doesn't know about the hint face unless you tell
ImageMagick about it.  By default, only the foreground and background
color attributes are passed.  The below snippet adds to those the
various font attributes.  As it queries various faces, specifically
‘pdf-links-read-link’ and the faces it inherits, it needs to be added to
your initialization file after you've customized any faces.

     (use-package pdf-links
       :config
       (let ((spec
              (apply #'append
                     (mapcar
                      (lambda (name)
                        (list name
                              (face-attribute 'pdf-links-read-link
                                              name nil 'default)))
                      '(:family :width :weight :slant)))))
         (setq pdf-links-read-link-convert-commands
               `("-density"    "96"
                 "-family"     ,(plist-get spec :family)
                 "-stretch"    ,(let* ((width (plist-get spec :width))
                                       (name (symbol-name width)))
                                  (replace-regexp-in-string "-" ""
                                                            (capitalize name)))
                 "-weight"     ,(pcase (plist-get spec :weight)
                                  ('ultra-light "Thin")
                                  ('extra-light "ExtraLight")
                                  ('light       "Light")
                                  ('semi-bold   "SemiBold")
                                  ('bold        "Bold")
                                  ('extra-bold  "ExtraBold")
                                  ('ultra-bold  "Black")
                                  (_weight      "Normal"))
                 "-style"      ,(pcase (plist-get spec :slant)
                                  ('italic  "Italic")
                                  ('oblique "Oblique")
                                  (_slant   "Normal"))
                 "-pointsize"  "%P"
                 "-undercolor" "%f"
                 "-fill"       "%b"
                 "-draw"       "text %X,%Y '%c'"))))


File: modus-themes.info,  Node: Note on the Notmuch logo,  Next: Note on goto-address-mode faces,  Prev: Note on pdf-tools link hints,  Up: Notes on individual packages

11.18 Note on the Notmuch logo
==============================

By default, the "hello" buffer of Notmuch includes a header with the
programs' logo and a couple of buttons.  The logo has the effect of
enlarging the height of the line, which negatively impacts the shape of
those buttons.  Disabling the logo fixes the problem:

     (setq notmuch-show-logo nil)


File: modus-themes.info,  Node: Note on goto-address-mode faces,  Prev: Note on the Notmuch logo,  Up: Notes on individual packages

11.19 Note on goto-address-mode faces
=====================================

The built-in ‘goto-address-mode’ uses heuristics to identify URLs and
email addresses in the current buffer.  It then applies a face to them
to change their style.  Some packages, such as ‘notmuch’, use this
minor-mode automatically.

   The faces are not declared with ‘defface’, meaning that it is better
that the theme does not modify them.  The user is thus encouraged to
consider including (or equivalent) this in their setup:

     (setq goto-address-url-face 'link
           goto-address-url-mouse-face 'highlight
           goto-address-mail-face 'link
           goto-address-mail-mouse-face 'highlight)

   My personal preference is to set ‘goto-address-mail-face’ to ‘nil’,
as it otherwise adds too much visual noise to the buffer (email
addresses stand out more, due to the use of the uncommon ‘@’ character
but also because they are often enclosed in angled brackets).


File: modus-themes.info,  Node: Frequently Asked Questions,  Next: Contributing,  Prev: Notes on individual packages,  Up: Top

12 Frequently Asked Questions
*****************************

In this section I provide answers related to some aspects of the Modus
themes' design and application.

* Menu:

* Is the contrast ratio about adjacent colors?::
* What does it mean to avoid exaggerations?::
* Why are colors mostly variants of blue, magenta, cyan?: Why are colors mostly variants of blue magenta cyan?.
* What is the best setup for legibility?::
* Are these color schemes?::
* Port the Modus themes to other platforms?::


File: modus-themes.info,  Node: Is the contrast ratio about adjacent colors?,  Next: What does it mean to avoid exaggerations?,  Up: Frequently Asked Questions

12.1 Is the contrast ratio about adjacent colors?
=================================================

The minimum contrast ratio in relative luminance that the themes conform
with always refers to any given combination of background and foreground
colors.  If I have some blue colored text next to a magenta one, both
against a white background, I do not mean to imply that blue:magenta is
7:1 in terms of relative luminance.  Rather, I state that blue:white and
magenta:white each are 7:1 or higher.

   The point of reference is always the background.  Because colors have
about the same minimum distance in luminance from their backdrop, they
necessarily are fairly close to each other in this measure.  A possible
blue:magenta combination would naturally be around 1:1 in contrast of
the sort here considered.

   To differentiate between sequential colors, I rely on hueness by
mapping contrasting hues to adjacent constructs, while avoiding
exaggerations.  A blue next to a magenta can be told apart regardless of
their respective contrast ratio against their common background.
Exceptions would be tiny characters in arguably not so realistic cases,
such as two dots drawn side-by-side which for some reason would need to
be colored differently.  They would still be legible though, which is
the primary objective of the Modus themes.


File: modus-themes.info,  Node: What does it mean to avoid exaggerations?,  Next: Why are colors mostly variants of blue magenta cyan?,  Prev: Is the contrast ratio about adjacent colors?,  Up: Frequently Asked Questions

12.2 What does it mean to avoid exaggerations?
==============================================

The Modus themes are designed with restraint, so that their default
looks do not overdo it with the application of color.

   *note Customization Options: Customization options.

   This is the non-quantifiable aspect of the themes' design: the
artistic part, if you will.  There are a lot of cases where color can be
used inconsiderately, without accounting for layout, typographic, or
other properties of the presentation.  For example, two headings with
distinct markers, such as leading asterisks in Org buffers, do not have
to have highly contrasting hues between them in order to be told apart:
the added element of contrast in hueness does not contribute
significantly more to the distinction between the headings than colors
whose hues are relatively closer to each other in the color space.

   Exaggerations can be hard to anticipate or identify.  Multiple shades
of blue and magenta in the same context may not seem optimal: one might
think that it would be better to use highly contrasting hues to ensure
that all colors stand out, such as by placing blue next to yellow, next
to magenta, and green.  That would, however, be a case of design for its
own sake; a case where color is being applied without consideration of
its end results in the given context.  Too many contrasting hues in
close proximity force an erratic rate to how the eye jumps from one
piece of text to the next.  Whereas multiple shades of, say, blue and
magenta can suffice to tell things apart and avoid excess coloration: a
harmonious rhythm.


File: modus-themes.info,  Node: Why are colors mostly variants of blue magenta cyan?,  Next: What is the best setup for legibility?,  Prev: What does it mean to avoid exaggerations?,  Up: Frequently Asked Questions

12.3 Why are colors mostly variants of blue, magenta, cyan?
===========================================================

Due to the innate properties of color, some options are better than
others for the accessibility purposes of the themes, the stylistic
consistency between ‘modus-operandi’ and ‘modus-vivendi’, and the
avoidance of exaggerations in design.

   *note What does it mean to avoid exaggerations?::

   What I describe as color is a function of three distinct channels of
light: red, green, blue.  In hexadecimal RGB notation, a color value is
read as three pairs of red, green, and blue light: ‘#RRGGBB’.  Of those
three, the most luminant is green, while the least luminant is blue.

   The three basic colors represent each of the channels of light.  They
can be intermixed to give us six colors: red and green derive yellow,
green and blue make cyan, red and blue turn into magenta.

   I can test the luminance of each of those against white and black to
get a sense of how not all colors are equally good for accessibility
(white is ‘#ffffff’, which means that all three light channels are fully
luminated, while black is ‘#000000’ meaning that no light is present
(notwithstanding display technology)).

     | Name    |         | #ffffff | #000000 |
     |---------+---------+---------+---------|
     | red     | #ff0000 |    4.00 |    5.25 |
     | yellow  | #ffff00 |    1.07 |   19.56 |
     | green   | #00ff00 |    1.37 |   15.30 |
     | cyan    | #00ffff |    1.25 |   16.75 |
     | blue    | #0000ff |    8.59 |    2.44 |
     | magenta | #ff00ff |    3.14 |    6.70 |

   *note Measure color contrast: DIY Measure color contrast.

   By reading this table I learn that every color that has a high level
of green light (green, yellow, cyan) is virtually unreadable against a
white background and, conversely, can be easily read against black.

   I can then infer that red and blue, in different combinations, with
green acting as calibrator for luminance, will give us fairly moderate
colors that pass the 7:1 target.  Blue with a bit of green produce
appropriate variants of cyan.  Similarly, blue combined with some red
and hints of green give us suitable shades of purple.

   Due to the need of maintaining some difference in hueness between
adjacent colors, it is not possible to make red, green, and yellow the
main colors, because blue cannot be used to control their luminance and,
thus the relevant space will shrink considerably.

   *note Is the contrast ratio about adjacent colors?::

   This phenomenon is best illustrated by the following table that
measures the relative luminance of shades of red, yellow, magenta
against white:

     |         | #ffffff |
     |---------+---------|
     | #990000 |    8.92 |
     | #995500 |    5.75 |
     | #990099 |    7.46 |

   I notice that equal values of red and blue light in ‘#990099’
(magenta shade) do not lead to a considerable change in luminance
compared with ‘#990000’ (red variant).  Whereas less amount of green
light in ‘#995500’ leads to a major drop in luminance relative to white.
It follows that using the green channel of light to calibrate the
luminance of colors is more effective than trying to do the same with
either red or blue (the latter is the least effective in that regard).

   When I need to work with several colors, it is always better to have
sufficient manoeuvring space, especially since I cannot pick arbitrary
colors but only those that satisfy the accessibility objectives of the
themes.

   As for why I do not mostly use green, yellow, cyan for the dark
theme, it is because those colors are far more luminant than their
counterparts on the other side of the spectrum, so to ensure that they
all have about the same contrast ratios I would have to alter their
hueness considerably.  In short, the effect would not be optimal as it
would lead to exaggerations.  Plus, it would make ‘modus-vivendi’ look
completely different than ‘modus-operandi’, to the effect that the two
could not be properly considered part of the same project.


File: modus-themes.info,  Node: What is the best setup for legibility?,  Next: Are these color schemes?,  Prev: Why are colors mostly variants of blue magenta cyan?,  Up: Frequently Asked Questions

12.4 What is the best setup for legibility?
===========================================

The Modus themes can be conceptually simplified as combinations of color
values that account for relative luminance and inner harmony.  Those
qualities do not guarantee that every end-user will have the same
experience, due to differences between people, but also because of
variances in hardware capabilities and configurations.  For the purposes
of this document, I may only provide suggestions pertaining to the
latter case.

   ‘modus-operandi’ is best used outdoors or in a room that either gets
direct sunlight or has plenty of light.  Whereas ‘modus-vivendi’ works
better when there is not a lot of sunshine or the room has a source of
light that is preferably a faint and/or warm one.  It is possible to use
‘modus-operandi’ at night and ‘modus-vivendi’ during the day, though
that will depend on several variables, such as one's overall perception
of color, the paint on the walls and how that contributes to the
impression of lightness in the room, the sense of space within the eye's
peripheral vision, hardware specifications, and environmental factors.

   In general, an additional source of light other than that of the
monitor can help reduce eye strain: the eyes are more relaxed when they
do not have to focus on one point to gather light.

   The monitor's display settings must be accounted for.  Gamma values,
in particular, need to be calibrated to neither amplify nor distort the
perception of black.  Same principle for sharpness, brightness, and
contrast as determined by the hardware, which all have an effect on how
text is read on the screen.

   There are software level methods on offer, such as the XrandR utility
for the X Window System (X.org), which can make gamma corrections for
each of the three channels of light (red, green, blue).  For example:

     xrandr --output LVDS1 --brightness 1.0 --gamma 0.76:0.75:0.68

   Typography is another variable.  Some font families are blurry at
small point sizes.  Others may have a regular weight that is lighter
(thinner) than that of their peers which may, under certain
circumstances, cause a halo effect around each glyph.

   The gist is that legibility cannot be fully solved at the theme
level.  The color combinations may have been optimized for
accessibility, though the remaining contributing factors in each case
need to be considered in full.


File: modus-themes.info,  Node: Are these color schemes?,  Next: Port the Modus themes to other platforms?,  Prev: What is the best setup for legibility?,  Up: Frequently Asked Questions

12.5 Are these color schemes?
=============================

No, the Modus themes are not color schemes.

   A color scheme is a collection of colors.  A good color scheme is a
combination of colors with an inner logic or abstract structure.

   A theme is a set of patterns that are applied across different
contexts.  A good theme is one that does so with consistency, though not
uniformity.

   In practical terms, a color scheme is what one uses when, for
example, they replace the first sixteen escape sequences of a terminal
emulator with color values of their preference.  The terminal offers the
option to choose, say, the exact value of what counts as "red", but does
not provide the means to control where that is mapped to and whether it
should also have other qualities such as a bold weight for the
underlying text or an added background color.  In contradistinction,
Emacs uses constructs known as "faces" which allow the user/developer to
specify where a given color will be used and whether it should be
accompanied by other typographic or stylistic attributes.

   By configuring the multitude of faces on offer I thus control both
which colors are applied and how they appear in their context.  When a
package wants to render each instance of "foo" with the "bar" face, it
is not requesting a specific color, which makes things considerably more
flexible as I can treat "bar" in its own right without necessarily
having to use some color value that I hardcoded somewhere.

   Which brings us to the distinction between consistency and uniformity
where my goal is always the former: I want things to look similar across
all interfaces, but I must never force a visual identity where that runs
contrary to the functionality of the given interface.  For instance, all
links are underlined by default yet there are cases such as when viewing
listings of emails in Gnus (and Mu4e, Notmuch) where (i) it is already
understood that one must follow the indicator or headline to view its
contents and (ii) underlining everything would make the interface
virtually unusable.

   Again, one must exercise judgement in order to avoid discrimination,
where "discrimination" refers to:

   • The treatment of substantially different magnitudes as if they were
     of the same class.
   • Or the treatment of the same class of magnitudes as if they were of
     a different class.

   (To treat similar things differently; to treat dissimilar things
alike.)

   If, in other words, one is to enforce uniformity without accounting
for the particular requirements of each case--the contextual demands for
usability beyond matters of color--they are making a not-so-obvious
error of treating different cases as if they were the same.

   The Modus themes prioritize "thematic consistency" over abstract
harmony or regularity among their applicable colors.  In concrete terms,
I do not claim that, say, my yellows are the best complements for my
blues because I generally avoid using complementary colors side-by-side,
so it is wrong to optimize for a decontextualised blue+yellow
combination.  Not to imply that my colors do not work well together
because they do, just to clarify that consistency of context is what
themes must strive for, and that requires widening the scope of the
design beyond the particularities of a color scheme.

   Long story short: color schemes and themes have different
requirements.  Please do not conflate the two.


File: modus-themes.info,  Node: Port the Modus themes to other platforms?,  Prev: Are these color schemes?,  Up: Frequently Asked Questions

12.6 Port the Modus themes to other platforms?
==============================================

There is no plan to port the themes to other platforms or text editors.
I (Protesilaos) only use GNU Emacs and thus cannot maintain code that
targets software I am either not familiar with or am not using on a
daily basis.

   While it is possible to produce a simulacrum based on a given
template, doing so would run contrary to how this project is maintained
where details matter greatly.

   Each program has its own requirements so it won't always be
possible--or indeed desirable--to have 1:1 correspondence between what
applies to Emacs and what should be done elsewhere.  No port should ever
strive to be a copy of the Emacs implementation, as no other program is
an Emacs equivalent, but instead try to follow the spirit of the design.
For example, some of the customization options accept a list as their
value, or an alist, which may not be possible to reproduce on other
platforms.

   *note Customization options::.

   In other words, if something must be done differently on a certain
editor then that is acceptable so long as (i) the accessibility
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/blue-yellow color deficiency
(deuteranopia and tritanopia) by avoiding red+green color coding
paradigms and/or by providing yellow+blue variants for deuteranopia and
red+cyan for tritanopia (*note Overview::).

   The latter criterion is the "je ne sais quoi" of the artistic aspect
of the themes, which is partially fleshed out in this manual.

   *note Frequently Asked Questions::.

   With regard to the artistic aspect (where "art" qua skill may amount
to an imprecise science), there is no hard-and-fast rule in effect as it
requires one to exercize discretion and make decisions based on
context-dependent information or constraints.  As is true with most
things in life, when in doubt, do not cling on to the letter of the law
but try to understand its spirit.

   For a trivial example: the curly underline that Emacs draws for
spelling errors is thinner than, e.g., what a graphical web browser has,
so if I was to design for an editor than has a thicker curly underline I
would make the applicable colors less intense to counterbalance the
typographic intensity of the added thickness.

   With those granted, if anyone is willing to develop a port of the
themes, they are welcome to contact me and I will do my best to help
them in their efforts.


File: modus-themes.info,  Node: Contributing,  Next: Acknowledgements,  Prev: Frequently Asked Questions,  Up: Top

13 Contributing
***************

This section documents the canonical sources of the themes and the ways
in which you can contribute to their ongoing development.

* Menu:

* Sources of the themes::
* Issues you can help with::
* Patches require copyright assignment to the FSF::


File: modus-themes.info,  Node: Sources of the themes,  Next: Issues you can help with,  Up: Contributing

13.1 Sources of the themes
==========================

   • Package name (GNU ELPA): ‘modus-themes’
   • Official manual: <https://protesilaos.com/emacs/modus-themes>
   • Change log: <https://protesilaos.com/emacs/modus-themes-changelog>
   • Color palette: <https://protesilaos.com/emacs/modus-themes-colors>
   • Sample pictures:
     <https://protesilaos.com/emacs/modus-themes-pictures>
   • Git repositories:
        • GitHub: <https://github.com/protesilaos/modus-themes>
        • GitLab: <https://gitlab.com/protesilaos/modus-themes>
   • Backronym: My Old Display Unexpectedly Sharpened ... themes.


File: modus-themes.info,  Node: Issues you can help with,  Next: Patches require copyright assignment to the FSF,  Prev: Sources of the themes,  Up: Contributing

13.2 Issues you can help with
=============================

A few tasks you can help with.

   • Suggest refinements to packages that are covered.
   • Report packages not covered thus far.
   • Report bugs, inconsistencies, shortcomings.
   • Help expand the documentation of covered-but-not-styled packages.
   • Suggest refinements to the color palette.
   • Help expand this document or any other piece of documentation.
   • Send patches for code refinements (if you need, ask me for help
     with Git--I all start out as beginners).

   *note Patches require copyright assignment to the FSF::.

   It is preferable that your feedback includes some screenshots, GIFs,
or short videos, as well as further instructions to reproduce a given
setup.  Though this is not a requirement.

   Whatever you do, bear in mind the overarching objective of the Modus
themes: to keep a contrast ratio that is greater or equal to 7:1 between
background and foreground colors.  If a compromise is ever necessary
between aesthetics and accessibility, it shall always be made in the
interest of the latter.


File: modus-themes.info,  Node: Patches require copyright assignment to the FSF,  Prev: Issues you can help with,  Up: Contributing

13.3 Patches require copyright assignment to the FSF
====================================================

Code contributions are most welcome.  For any major edit (more than 15
lines, or so, in aggregate per person), you need to make a copyright
assignment to the Free Software Foundation.  This is necessary because
the themes are part of the upstream Emacs distribution: the FSF must at
all times be in a position to enforce the GNU General Public License.

   Copyright assignment is a simple process.  Check the request form
below (please adapt it accordingly).  You must write an email to the
address mentioned in the form and then wait for the FSF to send you a
legal agreement.  Sign the document and file it back to them.  This
could all happen via email and take about a week.  You are encouraged to
go through this process.  You only need to do it once.  It will allow
you to make contributions to Emacs in general.

     Please email the following information to assign@gnu.org, and we
     will send you the assignment form for your past and future changes.

     Please use your full legal name (in ASCII characters) as the subject
     line of the message.

     REQUEST: SEND FORM FOR PAST AND FUTURE CHANGES

     [What is the name of the program or package you're contributing to?]

     GNU Emacs

     [Did you copy any files or text written by someone else in these changes?
     Even if that material is free software, we need to know about it.]

     Copied a few snippets from the same files I edited.  Their author,
     Protesilaos, has already assigned copyright to the Free Software
     Foundation.

     [Do you have an employer who might have a basis to claim to own
     your changes?  Do you attend a school which might make such a claim?]


     [For the copyright registration, what country are you a citizen of?]


     [What year were you born?]


     [Please write your email address here.]


     [Please write your postal address here.]





     [Which files have you changed so far, and which new files have you written
     so far?]



File: modus-themes.info,  Node: Acknowledgements,  Next: GNU Free Documentation License,  Prev: Contributing,  Up: Top

14 Acknowledgements
*******************

The Modus themes are a collective effort.  Every bit of work matters.

Author/maintainer
     Protesilaos.

Contributions to code or documentation
     Aleksei Gusev, Alex Griffin, Anders Johansson, Antonio Ruiz, Basil
     L. Contovounesios, Benjamin Kästner, Björn Lindström, Carlo
     Zancanaro, Christian Tietze, Daniel Colascione, Daniel Mendler,
     David Edmondson, Eli Zaretskii, Elias Gabriel Perez, Eric Ottosson,
     Frédéric Giquel, Fritz Grabo, Gautier Ponsinet, Heitor Augusto,
     Illia Ostapyshyn, Jacob S. Gordon, Jared Finder, JD Smith, Jimmy
     Yuen Ho Wong, Kevin Fleming, Kévin Le Gouguec, Koen van
     Greevenbroek, Kostadin Ninev, Leilei332, Madhavan Krishnan, Manuel
     Giraud, Markus Beppler, Matthew Stevenson, Mauro Aranda, Mike
     Olson, Nacho Barrientos, Niall Dooley, Nicolas De Jaeghere, Paul
     David, Pavel Novichkov, Philip Kaludercic, Pierre Téchoueyres,
     Rahul M. Juliato, Rudolf Adamkovič, Sergey Nichiporchik, Shawn
     LeMaster, Shreyas Ragavan, Stefan x Kangas, Stephen Berman, Stephen
     Gildea, Steve Downey, Steven Allen, Suleyman Boyar, Thanos Apollo,
     Tomasz Hołubowicz, Utkarsh Singh, Vincent Murphy, Xinglu Chen,
     Yuanchen Xie, Yuta Yamamoto, fluentpwn, okamsn, ukiran03.

Ideas and user feedback
     Aaron Jensen, Adam Porter, Adam Spiers, Adrian Manea, Aleksei
     Pirogov, Alex Griffin, Alex Koen, Alex Peitsinis, Alexandr Semenov,
     Alexey Shmalko, Alok Singh, Anders Johansson, André Alexandre
     Gomes, Andrew Tropin, Antonio Hernández Blas, Arif Rezai, Ashton
     Wiersdorf, Augusto Stoffel, Basil L. Contovounesios, Bernd
     Rellermeyer, Burgess Chang, Charlotte Van Petegem, Christian
     Tietze, Christopher Dimech, Christopher League, Damien Cassou,
     Daniel Mendler, Dario Gjorgjevski, David Edmondson, Davor Rotim,
     Divan Santana, Dmitry Gutov, Dominik Schrempf, Eliraz Kedmi,
     Emanuele Michele Alberto Monterosso, Eshel Yaron, Farasha Euker,
     Feng Shu, Filippo Argiolas, Gaston Cabotin, Gautier Ponsinet, Gerry
     Agbobada, Gianluca Recchia, Gonçalo Marrafa, Guilherme Semente,
     Gustavo Barros, Hörmetjan Yiltiz, Ilja Kocken, Imran Khan, Iris
     Garcia, Ivan Popovych, Jabir Ali Ouassou, James Ferguson, JD Smith,
     Jeremy Friesen, Jerry Zhang, Johannes Grødem, John Haman, John
     Sullivan, John Wick, Jonas Collberg, Jorge Morais, Joshua O'Connor,
     Julio C.  Villasante, Kenta Usami, Kevin Fleming, Kévin Le Gouguec,
     Kevin Kainan Li, Kostadin Ninev, Laith Bahodi, Lasse Lindner, Len
     Trigg, Lennart C. Karssen, Lucas Jimenez, Luis Miguel Castañeda,
     Magne Hov, Manuel Giraud, Manuel Uberti, Mark Bestley, Mark Burton,
     Mark Simpson, Marko Kocic, Markus Beppler, Matt Armstrong, Matthias
     Fuchs, Mattias Engdegård, Mauro Aranda, Maxime Tréca, Michael
     Goldenberg, Mike Crowe, Morgan Smith, Morgan Willcock, Morten
     Kjeldgaard, Murilo Pereira, Nicky van Foreest, Nicolas De Jaeghere,
     Nicolas Semrau, Olaf Meeuwissen, Oliver Epper, Pablo Stafforini,
     Paul Poloskov, Pengji Zhang, Pete Kazmier, Peter Wu, Philip
     Kaludercic, Pierre Téchoueyres, Pranshu Sharma, Przemysław Kryger,
     Robert Hepple, Roman Rudakov, Roshan Shariff, Russell Sim, Ryan
     Phillips, Rytis Paškauskas, Rudolf Adamkovič, Sam Kleinman, Samuel
     Culpepper, Saša Janiška, Shreyas Ragavan, Simon Pugnet, Stéphane
     Marks, Steve Downey, Tassilo Horn, Thanos Apollo, Thibaut Verron,
     Thomas Heartman, Togan Muftuoglu, Tony Zorman, Trey Merkley, Tomasz
     Hołubowicz, Toon Claes, Troy Brown, Uri Sharf, Utkarsh Singh,
     Vincent Foley, Yuta Yamamoto, Zoltan Kiraly.  As well as users:
     Ben, CsBigDataHub1, Emacs Contrib, Eugene, Fourchaux, Fredrik,
     Moesasji, Nick, Summer Emacs, TheBlob42, TitusMu, Trey,
     aikrahguzar, amano-kenji, baconabo, bangedorrunt, bepolymathe,
     bit9tream, case-lambda, chainedghost, derek-upham, doolio,
     fleimgruber, gitrj95, iSeeU, jixiuf, ltmsyvag, okamsn,
     pedro-nonfree, pRot0ta1p, realazy, shimeike, shipmints,
     soaringbird, tumashu, vpxyz, wakamenod.

Packaging
     Basil L. Contovounesios, Eli Zaretskii, Glenn Morris, Mauro Aranda,
     Richard Stallman, Stefan Kangas (core Emacs), Stefan Monnier (GNU
     Elpa), André Alexandre Gomes, Andrew Tropin, Dimakakos Dimos,
     Morgan Smith, Nicolas Goaziou (Guix), Dhavan Vaidya (Debian).

Inspiration for certain features
     Bozhidar Batsov (zenburn-theme), Fabrice Niessen (leuven-theme).

   Special thanks (from A-Z) to Daniel Mendler, Gustavo Barros, Manuel
Uberti, Nicolas De Jaeghere, and Omar Antolín Camarena for their long
time contributions and insightful commentary on key aspects of the
themes' design and/or aspects of their functionality.

   All errors are my own.


File: modus-themes.info,  Node: GNU Free Documentation License,  Next: Indices,  Prev: Acknowledgements,  Up: Top

Appendix A GNU Free Documentation License
*****************************************

                     Version 1.3, 3 November 2008

     Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
     <https://fsf.org/>

     Everyone is permitted to copy and distribute verbatim copies
     of this license document, but changing it is not allowed.

  0. PREAMBLE

     The purpose of this License is to make a manual, textbook, or other
     functional and useful document “free” in the sense of freedom: to
     assure everyone the effective freedom to copy and redistribute it,
     with or without modifying it, either commercially or
     noncommercially.  Secondarily, this License preserves for the
     author and publisher a way to get credit for their work, while not
     being considered responsible for modifications made by others.

     This License is a kind of "copyleft", which means that derivative
     works of the document must themselves be free in the same sense.
     It complements the GNU General Public License, which is a copyleft
     license designed for free software.

     We have designed this License in order to use it for manuals for
     free software, because free software needs free documentation: a
     free program should come with manuals providing the same freedoms
     that the software does.  But this License is not limited to
     software manuals; it can be used for any textual work, regardless
     of subject matter or whether it is published as a printed book.  We
     recommend this License principally for works whose purpose is
     instruction or reference.

  1. APPLICABILITY AND DEFINITIONS

     This License applies to any manual or other work, in any medium,
     that contains a notice placed by the copyright holder saying it can
     be distributed under the terms of this License.  Such a notice
     grants a world-wide, royalty-free license, unlimited in duration,
     to use that work under the conditions stated herein.  The
     "Document", below, refers to any such manual or work.  Any member
     of the public is a licensee, and is addressed as "you".  You accept
     the license if you copy, modify or distribute the work in a way
     requiring permission under copyright law.

     A "Modified Version" of the Document means any work containing the
     Document or a portion of it, either copied verbatim, or with
     modifications and/or translated into another language.

     A "Secondary Section" is a named appendix or a front-matter section
     of the Document that deals exclusively with the relationship of the
     publishers or authors of the Document to the Document's overall
     subject (or to related matters) and contains nothing that could
     fall directly within that overall subject.  (Thus, if the Document
     is in part a textbook of mathematics, a Secondary Section may not
     explain any mathematics.)  The relationship could be a matter of
     historical connection with the subject or with related matters, or
     of legal, commercial, philosophical, ethical or political position
     regarding them.

     The "Invariant Sections" are certain Secondary Sections whose
     titles are designated, as being those of Invariant Sections, in the
     notice that says that the Document is released under this License.
     If a section does not fit the above definition of Secondary then it
     is not allowed to be designated as Invariant.  The Document may
     contain zero Invariant Sections.  If the Document does not identify
     any Invariant Sections then there are none.

     The "Cover Texts" are certain short passages of text that are
     listed, as Front-Cover Texts or Back-Cover Texts, in the notice
     that says that the Document is released under this License.  A
     Front-Cover Text may be at most 5 words, and a Back-Cover Text may
     be at most 25 words.

     A "Transparent" copy of the Document means a machine-readable copy,
     represented in a format whose specification is available to the
     general public, that is suitable for revising the document
     straightforwardly with generic text editors or (for images composed
     of pixels) generic paint programs or (for drawings) some widely
     available drawing editor, and that is suitable for input to text
     formatters or for automatic translation to a variety of formats
     suitable for input to text formatters.  A copy made in an otherwise
     Transparent file format whose markup, or absence of markup, has
     been arranged to thwart or discourage subsequent modification by
     readers is not Transparent.  An image format is not Transparent if
     used for any substantial amount of text.  A copy that is not
     "Transparent" is called "Opaque".

     Examples of suitable formats for Transparent copies include plain
     ASCII without markup, Texinfo input format, LaTeX input format,
     SGML or XML using a publicly available DTD, and standard-conforming
     simple HTML, PostScript or PDF designed for human modification.
     Examples of transparent image formats include PNG, XCF and JPG.
     Opaque formats include proprietary formats that can be read and
     edited only by proprietary word processors, SGML or XML for which
     the DTD and/or processing tools are not generally available, and
     the machine-generated HTML, PostScript or PDF produced by some word
     processors for output purposes only.

     The "Title Page" means, for a printed book, the title page itself,
     plus such following pages as are needed to hold, legibly, the
     material this License requires to appear in the title page.  For
     works in formats which do not have any title page as such, "Title
     Page" means the text near the most prominent appearance of the
     work's title, preceding the beginning of the body of the text.

     The "publisher" means any person or entity that distributes copies
     of the Document to the public.

     A section "Entitled XYZ" means a named subunit of the Document
     whose title either is precisely XYZ or contains XYZ in parentheses
     following text that translates XYZ in another language.  (Here XYZ
     stands for a specific section name mentioned below, such as
     "Acknowledgements", "Dedications", "Endorsements", or "History".)
     To "Preserve the Title" of such a section when you modify the
     Document means that it remains a section "Entitled XYZ" according
     to this definition.

     The Document may include Warranty Disclaimers next to the notice
     which states that this License applies to the Document.  These
     Warranty Disclaimers are considered to be included by reference in
     this License, but only as regards disclaiming warranties: any other
     implication that these Warranty Disclaimers may have is void and
     has no effect on the meaning of this License.

  2. VERBATIM COPYING

     You may copy and distribute the Document in any medium, either
     commercially or noncommercially, provided that this License, the
     copyright notices, and the license notice saying this License
     applies to the Document are reproduced in all copies, and that you
     add no other conditions whatsoever to those of this License.  You
     may not use technical measures to obstruct or control the reading
     or further copying of the copies you make or distribute.  However,
     you may accept compensation in exchange for copies.  If you
     distribute a large enough number of copies you must also follow the
     conditions in section 3.

     You may also lend copies, under the same conditions stated above,
     and you may publicly display copies.

  3. COPYING IN QUANTITY

     If you publish printed copies (or copies in media that commonly
     have printed covers) of the Document, numbering more than 100, and
     the Document's license notice requires Cover Texts, you must
     enclose the copies in covers that carry, clearly and legibly, all
     these Cover Texts: Front-Cover Texts on the front cover, and
     Back-Cover Texts on the back cover.  Both covers must also clearly
     and legibly identify you as the publisher of these copies.  The
     front cover must present the full title with all words of the title
     equally prominent and visible.  You may add other material on the
     covers in addition.  Copying with changes limited to the covers, as
     long as they preserve the title of the Document and satisfy these
     conditions, can be treated as verbatim copying in other respects.

     If the required texts for either cover are too voluminous to fit
     legibly, you should put the first ones listed (as many as fit
     reasonably) on the actual cover, and continue the rest onto
     adjacent pages.

     If you publish or distribute Opaque copies of the Document
     numbering more than 100, you must either include a machine-readable
     Transparent copy along with each Opaque copy, or state in or with
     each Opaque copy a computer-network location from which the general
     network-using public has access to download using public-standard
     network protocols a complete Transparent copy of the Document, free
     of added material.  If you use the latter option, you must take
     reasonably prudent steps, when you begin distribution of Opaque
     copies in quantity, to ensure that this Transparent copy will
     remain thus accessible at the stated location until at least one
     year after the last time you distribute an Opaque copy (directly or
     through your agents or retailers) of that edition to the public.

     It is requested, but not required, that you contact the authors of
     the Document well before redistributing any large number of copies,
     to give them a chance to provide you with an updated version of the
     Document.

  4. MODIFICATIONS

     You may copy and distribute a Modified Version of the Document
     under the conditions of sections 2 and 3 above, provided that you
     release the Modified Version under precisely this License, with the
     Modified Version filling the role of the Document, thus licensing
     distribution and modification of the Modified Version to whoever
     possesses a copy of it.  In addition, you must do these things in
     the Modified Version:

       A. Use in the Title Page (and on the covers, if any) a title
          distinct from that of the Document, and from those of previous
          versions (which should, if there were any, be listed in the
          History section of the Document).  You may use the same title
          as a previous version if the original publisher of that
          version gives permission.

       B. List on the Title Page, as authors, one or more persons or
          entities responsible for authorship of the modifications in
          the Modified Version, together with at least five of the
          principal authors of the Document (all of its principal
          authors, if it has fewer than five), unless they release you
          from this requirement.

       C. State on the Title page the name of the publisher of the
          Modified Version, as the publisher.

       D. Preserve all the copyright notices of the Document.

       E. Add an appropriate copyright notice for your modifications
          adjacent to the other copyright notices.

       F. Include, immediately after the copyright notices, a license
          notice giving the public permission to use the Modified
          Version under the terms of this License, in the form shown in
          the Addendum below.

       G. Preserve in that license notice the full lists of Invariant
          Sections and required Cover Texts given in the Document's
          license notice.

       H. Include an unaltered copy of this License.

       I. Preserve the section Entitled "History", Preserve its Title,
          and add to it an item stating at least the title, year, new
          authors, and publisher of the Modified Version as given on the
          Title Page.  If there is no section Entitled "History" in the
          Document, create one stating the title, year, authors, and
          publisher of the Document as given on its Title Page, then add
          an item describing the Modified Version as stated in the
          previous sentence.

       J. Preserve the network location, if any, given in the Document
          for public access to a Transparent copy of the Document, and
          likewise the network locations given in the Document for
          previous versions it was based on.  These may be placed in the
          "History" section.  You may omit a network location for a work
          that was published at least four years before the Document
          itself, or if the original publisher of the version it refers
          to gives permission.

       K. For any section Entitled "Acknowledgements" or "Dedications",
          Preserve the Title of the section, and preserve in the section
          all the substance and tone of each of the contributor
          acknowledgements and/or dedications given therein.

       L. Preserve all the Invariant Sections of the Document, unaltered
          in their text and in their titles.  Section numbers or the
          equivalent are not considered part of the section titles.

       M. Delete any section Entitled "Endorsements".  Such a section
          may not be included in the Modified Version.

       N. Do not retitle any existing section to be Entitled
          "Endorsements" or to conflict in title with any Invariant
          Section.

       O. Preserve any Warranty Disclaimers.

     If the Modified Version includes new front-matter sections or
     appendices that qualify as Secondary Sections and contain no
     material copied from the Document, you may at your option designate
     some or all of these sections as invariant.  To do this, add their
     titles to the list of Invariant Sections in the Modified Version's
     license notice.  These titles must be distinct from any other
     section titles.

     You may add a section Entitled "Endorsements", provided it contains
     nothing but endorsements of your Modified Version by various
     parties--for example, statements of peer review or that the text
     has been approved by an organization as the authoritative
     definition of a standard.

     You may add a passage of up to five words as a Front-Cover Text,
     and a passage of up to 25 words as a Back-Cover Text, to the end of
     the list of Cover Texts in the Modified Version.  Only one passage
     of Front-Cover Text and one of Back-Cover Text may be added by (or
     through arrangements made by) any one entity.  If the Document
     already includes a cover text for the same cover, previously added
     by you or by arrangement made by the same entity you are acting on
     behalf of, you may not add another; but you may replace the old
     one, on explicit permission from the previous publisher that added
     the old one.

     The author(s) and publisher(s) of the Document do not by this
     License give permission to use their names for publicity for or to
     assert or imply endorsement of any Modified Version.

  5. COMBINING DOCUMENTS

     You may combine the Document with other documents released under
     this License, under the terms defined in section 4 above for
     modified versions, provided that you include in the combination all
     of the Invariant Sections of all of the original documents,
     unmodified, and list them all as Invariant Sections of your
     combined work in its license notice, and that you preserve all
     their Warranty Disclaimers.

     The combined work need only contain one copy of this License, and
     multiple identical Invariant Sections may be replaced with a single
     copy.  If there are multiple Invariant Sections with the same name
     but different contents, make the title of each such section unique
     by adding at the end of it, in parentheses, the name of the
     original author or publisher of that section if known, or else a
     unique number.  Make the same adjustment to the section titles in
     the list of Invariant Sections in the license notice of the
     combined work.

     In the combination, you must combine any sections Entitled
     "History" in the various original documents, forming one section
     Entitled "History"; likewise combine any sections Entitled
     "Acknowledgements", and any sections Entitled "Dedications".  You
     must delete all sections Entitled "Endorsements."

  6. COLLECTIONS OF DOCUMENTS

     You may make a collection consisting of the Document and other
     documents released under this License, and replace the individual
     copies of this License in the various documents with a single copy
     that is included in the collection, provided that you follow the
     rules of this License for verbatim copying of each of the documents
     in all other respects.

     You may extract a single document from such a collection, and
     distribute it individually under this License, provided you insert
     a copy of this License into the extracted document, and follow this
     License in all other respects regarding verbatim copying of that
     document.

  7. AGGREGATION WITH INDEPENDENT WORKS

     A compilation of the Document or its derivatives with other
     separate and independent documents or works, in or on a volume of a
     storage or distribution medium, is called an "aggregate" if the
     copyright resulting from the compilation is not used to limit the
     legal rights of the compilation's users beyond what the individual
     works permit.  When the Document is included in an aggregate, this
     License does not apply to the other works in the aggregate which
     are not themselves derivative works of the Document.

     If the Cover Text requirement of section 3 is applicable to these
     copies of the Document, then if the Document is less than one half
     of the entire aggregate, the Document's Cover Texts may be placed
     on covers that bracket the Document within the aggregate, or the
     electronic equivalent of covers if the Document is in electronic
     form.  Otherwise they must appear on printed covers that bracket
     the whole aggregate.

  8. TRANSLATION

     Translation is considered a kind of modification, so you may
     distribute translations of the Document under the terms of section
     4.  Replacing Invariant Sections with translations requires special
     permission from their copyright holders, but you may include
     translations of some or all Invariant Sections in addition to the
     original versions of these Invariant Sections.  You may include a
     translation of this License, and all the license notices in the
     Document, and any Warranty Disclaimers, provided that you also
     include the original English version of this License and the
     original versions of those notices and disclaimers.  In case of a
     disagreement between the translation and the original version of
     this License or a notice or disclaimer, the original version will
     prevail.

     If a section in the Document is Entitled "Acknowledgements",
     "Dedications", or "History", the requirement (section 4) to
     Preserve its Title (section 1) will typically require changing the
     actual title.

  9. TERMINATION

     You may not copy, modify, sublicense, or distribute the Document
     except as expressly provided under this License.  Any attempt
     otherwise to copy, modify, sublicense, or distribute it is void,
     and will automatically terminate your rights under this License.

     However, if you cease all violation of this License, then your
     license from a particular copyright holder is reinstated (a)
     provisionally, unless and until the copyright holder explicitly and
     finally terminates your license, and (b) permanently, if the
     copyright holder fails to notify you of the violation by some
     reasonable means prior to 60 days after the cessation.

     Moreover, your license from a particular copyright holder is
     reinstated permanently if the copyright holder notifies you of the
     violation by some reasonable means, this is the first time you have
     received notice of violation of this License (for any work) from
     that copyright holder, and you cure the violation prior to 30 days
     after your receipt of the notice.

     Termination of your rights under this section does not terminate
     the licenses of parties who have received copies or rights from you
     under this License.  If your rights have been terminated and not
     permanently reinstated, receipt of a copy of some or all of the
     same material does not give you any rights to use it.

  10. FUTURE REVISIONS OF THIS LICENSE

     The Free Software Foundation may publish new, revised versions of
     the GNU Free Documentation License from time to time.  Such new
     versions will be similar in spirit to the present version, but may
     differ in detail to address new problems or concerns.  See
     <https://www.gnu.org/licenses/>.

     Each version of the License is given a distinguishing version
     number.  If the Document specifies that a particular numbered
     version of this License "or any later version" applies to it, you
     have the option of following the terms and conditions either of
     that specified version or of any later version that has been
     published (not as a draft) by the Free Software Foundation.  If the
     Document does not specify a version number of this License, you may
     choose any version ever published (not as a draft) by the Free
     Software Foundation.  If the Document specifies that a proxy can
     decide which future versions of this License can be used, that
     proxy's public statement of acceptance of a version permanently
     authorizes you to choose that version for the Document.

  11. RELICENSING

     "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
     World Wide Web server that publishes copyrightable works and also
     provides prominent facilities for anybody to edit those works.  A
     public wiki that anybody can edit is an example of such a server.
     A "Massive Multiauthor Collaboration" (or "MMC") contained in the
     site means any set of copyrightable works thus published on the MMC
     site.

     "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
     license published by Creative Commons Corporation, a not-for-profit
     corporation with a principal place of business in San Francisco,
     California, as well as future copyleft versions of that license
     published by that same organization.

     "Incorporate" means to publish or republish a Document, in whole or
     in part, as part of another Document.

     An MMC is "eligible for relicensing" if it is licensed under this
     License, and if all works that were first published under this
     License somewhere other than this MMC, and subsequently
     incorporated in whole or in part into the MMC, (1) had no cover
     texts or invariant sections, and (2) were thus incorporated prior
     to November 1, 2008.

     The operator of an MMC Site may republish an MMC contained in the
     site under CC-BY-SA on the same site at any time before August 1,
     2009, provided the MMC is eligible for relicensing.

ADDENDUM: How to use this License for your documents
====================================================

To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and license
notices just after the title page:

       Copyright (C)  YEAR  YOUR NAME.
       Permission is granted to copy, distribute and/or modify this document
       under the terms of the GNU Free Documentation License, Version 1.3
       or any later version published by the Free Software Foundation;
       with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
       Texts.  A copy of the license is included in the section entitled ``GNU
       Free Documentation License''.

   If you have Invariant Sections, Front-Cover Texts and Back-Cover
Texts, replace the "with...Texts." line with this:

         with the Invariant Sections being LIST THEIR TITLES, with
         the Front-Cover Texts being LIST, and with the Back-Cover Texts
         being LIST.

   If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.

   If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of free
software license, such as the GNU General Public License, to permit
their use in free software.


File: modus-themes.info,  Node: Indices,  Prev: GNU Free Documentation License,  Up: Top

B Indices
*********

* Menu:

* Function index::
* Variable index::
* Concept index::


File: modus-themes.info,  Node: Function index,  Next: Variable index,  Up: Indices

B.1 Function index
==================

[index]
* Menu:

* enable-theme:                          Difference between loading and enabling.
                                                               (line  6)
* load-theme:                            Enable and load.      (line  6)
* load-theme <1>:                        Difference between loading and enabling.
                                                               (line  6)
* modus-themes-contrast:                 DIY Measure color contrast.
                                                               (line  6)
* modus-themes-define-derivative-command: Create convenience commands to load a derivative theme.
                                                               (line 10)
* modus-themes-generate-palette:         Complete example that also uses modus-themes-generate-palette.
                                                               (line 52)
* modus-themes-get-all-known-themes:     Determine what counts as a Modus theme.
                                                               (line 10)
* modus-themes-get-color-value:          Get a single color from the palette with modus-themes-get-color-value.
                                                               (line  6)
* modus-themes-get-themes:               Option for which themes to toggle.
                                                               (line  6)
* modus-themes-get-themes <1>:           Determine what counts as a Modus theme.
                                                               (line 16)
* modus-themes-include-derivatives-mode: Determine what counts as a Modus theme.
                                                               (line 47)
* modus-themes-list-colors:              Preview theme colors. (line  6)
* modus-themes-list-colors-current:      Preview theme colors. (line 11)
* modus-themes-load-random:              Enable and load.      (line 19)
* modus-themes-load-random-dark:         Enable and load.      (line 46)
* modus-themes-load-random-light:        Enable and load.      (line 48)
* modus-themes-load-theme:               Enable and load.      (line  6)
* modus-themes-preview-colors:           Preview theme colors. (line 19)
* modus-themes-preview-colors-current:   Preview theme colors. (line 19)
* modus-themes-preview-mode:             Commands for the preview palette buffer.
                                                               (line  6)
* modus-themes-preview-mode-copy-color:  Commands for the preview palette buffer.
                                                               (line 20)
* modus-themes-preview-mode-copy-entry:  Commands for the preview palette buffer.
                                                               (line 27)
* modus-themes-preview-mode-mark:        Commands for the preview palette buffer.
                                                               (line 34)
* modus-themes-preview-mode-mark-all:    Commands for the preview palette buffer.
                                                               (line 34)
* modus-themes-preview-mode-unmark:      Commands for the preview palette buffer.
                                                               (line 34)
* modus-themes-preview-mode-unmark-all:  Commands for the preview palette buffer.
                                                               (line 34)
* modus-themes-rotate:                   Enable and load.      (line 19)
* modus-themes-rotate <1>:               Option for which themes to rotate.
                                                               (line  6)
* modus-themes-select:                   Enable and load.      (line 19)
* modus-themes-select-dark:              Enable and load.      (line 42)
* modus-themes-select-light:             Enable and load.      (line 44)
* modus-themes-theme:                    Build on top of the Modus themes.
                                                               (line 20)
* modus-themes-toggle:                   Enable and load.      (line 19)
* modus-themes-toggle <1>:               Option for which themes to toggle.
                                                               (line  6)
* modus-themes-wcag-formula:             DIY Measure color contrast.
                                                               (line  6)
* modus-themes-with-colors:              Use theme colors in code with modus-themes-with-colors.
                                                               (line 10)


File: modus-themes.info,  Node: Variable index,  Next: Concept index,  Prev: Function index,  Up: Indices

B.2 Variable index
==================

[index]
* Menu:

* ~modus-themes-define-derivative-command-known-suffixes~: Create convenience commands to load a derivative theme.
                                                               (line 23)
* custom-enabled-themes:                 Difference between loading and enabling.
                                                               (line  6)
* modus-operandi-deuteranopia-palette-overrides: Palette overrides.
                                                               (line 30)
* modus-operandi-deuteranopia-palette-user: Palette extension. (line 24)
* modus-operandi-palette-overrides:      Palette overrides.    (line 28)
* modus-operandi-palette-user:           Palette extension.    (line 20)
* modus-operandi-tinted-palette-overrides: Palette overrides.  (line 32)
* modus-operandi-tinted-palette-user:    Palette extension.    (line 22)
* modus-operandi-tritanopia-palette-overrides: Palette overrides.
                                                               (line 34)
* modus-operandi-tritanopia-palette-user: Palette extension.   (line 26)
* modus-themes-after-load-theme-hook:    Enable and load.      (line  6)
* modus-themes-bold-constructs:          Bold constructs.      (line  6)
* modus-themes-common-palette-overrides: Palette overrides.    (line 22)
* modus-themes-common-palette-user:      Palette extension.    (line 16)
* modus-themes-custom-variables:         Build on top of the Modus themes.
                                                               (line 68)
* modus-themes-disable-other-themes:     Disable other themes. (line  6)
* modus-themes-faces:                    Build on top of the Modus themes.
                                                               (line 62)
* modus-themes-headings:                 Heading styles.       (line  6)
* modus-themes-italic-constructs:        Italic constructs.    (line  6)
* modus-themes-mixed-fonts:              Mixed fonts.          (line  6)
* modus-themes-operandi-palette:         Complete example that also uses modus-themes-generate-palette.
                                                               (line 94)
* modus-themes-org-blocks:               Org mode blocks.      (line  6)
* modus-themes-post-load-hook:           Enable and load.      (line  6)
* modus-themes-preset-overrides-cooler:  DIY Palette override presets.
                                                               (line 29)
* modus-themes-preset-overrides-faint:   DIY Palette override presets.
                                                               (line 16)
* modus-themes-preset-overrides-intense: DIY Palette override presets.
                                                               (line 25)
* modus-themes-preset-overrides-warmer:  DIY Palette override presets.
                                                               (line 29)
* modus-themes-preview-mode-map:         Commands for the preview palette buffer.
                                                               (line  6)
* modus-themes-registered-items:         Build on top of the Modus themes.
                                                               (line 20)
* modus-themes-to-rotate:                Option for which themes to rotate.
                                                               (line  6)
* modus-themes-to-toggle:                Option for which themes to toggle.
                                                               (line  6)
* modus-themes-variable-pitch-ui:        UI typeface.          (line  6)
* modus-themes-vivendi-palette:          Complete example that also uses modus-themes-generate-palette.
                                                               (line 94)
* modus-vivendi-deuteranopia-palette-overrides: Palette overrides.
                                                               (line 38)
* modus-vivendi-deuteranopia-palette-user: Palette extension.  (line 32)
* modus-vivendi-palette-overrides:       Palette overrides.    (line 36)
* modus-vivendi-palette-user:            Palette extension.    (line 28)
* modus-vivendi-tinted-palette-overrides: Palette overrides.   (line 40)
* modus-vivendi-tinted-palette-user:     Palette extension.    (line 30)
* modus-vivendi-tritanopia-palette-overrides: Palette overrides.
                                                               (line 42)
* modus-vivendi-tritanopia-palette-user: Palette extension.    (line 34)


File: modus-themes.info,  Node: Concept index,  Prev: Variable index,  Up: Indices

B.3 Concept index
=================

[index]
* Menu:

* Avoiding exaggerations in design:      What does it mean to avoid exaggerations?.
                                                                (line 6)
* Bold and italic fonts:                 DIY Configure bold and italic faces.
                                                                (line 6)
* Changelog:                             Learn about the latest changes.
                                                                (line 6)
* Color accuracy of terminal emulators:  DIY More accurate colors in terminal emulators.
                                                                (line 6)
* Color contrast:                        DIY Measure color contrast.
                                                                (line 6)
* Contrast between adjacent colors:      Is the contrast ratio about adjacent colors?.
                                                                (line 6)
* Contributing:                          Issues you can help with.
                                                                (line 6)
* Contributors:                          Acknowledgements.      (line 6)
* Easily define a fully fledged Modus palette: Complete example that also uses modus-themes-generate-palette.
                                                                (line 6)
* Essential configuration:               Enable and load.       (line 6)
* Explicitly supported packages:         Supported packages.    (line 6)
* Font configurations:                   DIY Font configurations for Org and others.
                                                                (line 6)
* Fonts in EWW, Elfeed, Ement, and SHR:  Note on SHR fonts.     (line 6)
* Frequently Asked Questions:            Frequently Asked Questions.
                                                                (line 6)
* General setup for readability:         What is the best setup for legibility?.
                                                                (line 6)
* Implicitly supported packages:         Indirectly covered packages.
                                                                (line 6)
* Innate color qualities of the palette: Why are colors mostly variants of blue magenta cyan?.
                                                                (line 6)
* load-theme VS enable-theme:            Difference between loading and enabling.
                                                                (line 6)
* Org custom emphasis faces:             DIY Custom Org emphasis faces.
                                                                (line 6)
* Org custom todo faces:                 DIY Custom Org todo keyword and priority faces.
                                                                (line 6)
* Porting the themes to other editors:   Port the Modus themes to other platforms?.
                                                                (line 6)
* Preview named colors or semantic color mappings: Preview theme colors.
                                                                (line 6)
* Pure white and pure black in terminal emulators: DIY Range of color with terminal emulators.
                                                                (line 6)
* Remapping faces:                       DIY Remap face with local value.
                                                                (line 6)
* Remapping pdf-tools backdrop:          DIY Backdrop for pdf-tools.
                                                                (line 6)
* sample configuration:                  Sample configuration.  (line 6)
* Screenshots:                           How do the themes look like.
                                                                (line 6)
* Sources of the themes:                 Sources of the themes. (line 6)
* Switch themes without load-theme:      DIY Toggle themes without reloading them.
                                                                (line 6)
* Themes, not color schemes:             Are these color schemes?.
                                                                (line 6)
* Use colors from the palette anywhere:  Use theme colors in code with modus-themes-with-colors.
                                                                (line 6)
* use-package configuration:             Sample configuration.  (line 6)



Tag Table:
Node: Top874
Node: Overview9012
Node: How do the themes look like11823
Node: Learn about the latest changes12182
Node: Installation12569
Node: Install manually from source13168
Node: Install from source with package-vc-install14127
Node: Install from GNU ELPA14891
Node: Dealing with byte compilation errors15494
Node: Sample configuration16617
Node: The require-theme for built-in Emacs themes18264
Node: Enable and load19776
Node: Difference between loading and enabling21757
Node: Customization options22620
Node: Disable other themes25467
Node: Bold constructs26164
Node: Italic constructs26993
Node: Option for which themes to toggle27956
Node: Option for which themes to rotate28460
Node: Mixed fonts29120
Node: Org mode blocks30233
Node: Heading styles30872
Node: UI typeface35295
Node: Palette overrides36266
Node: Palette extension40622
Node: Preview theme colors43097
Node: Commands for the preview palette buffer44752
Node: Use colors from the Modus themes palette46830
Node: Get a single color from the palette with modus-themes-get-color-value47694
Node: Use theme colors in code with modus-themes-with-colors50054
Node: Advanced customization52306
Node: DIY Palette override presets54120
Node: DIY Add support for vc-annotate56948
Node: DIY Add support for engrave-faces58430
Node: DIY Stylistic variants using palette overrides68413
Node: DIY Make the mode line borderless70471
Node: DIY Make the active mode line colorful71844
Node: DIY Make the tab bar more or less colorful74060
Node: DIY Make the fringe invisible or another color75995
Node: DIY Make links use subtle or no underlines77190
Node: DIY Make prompts more or less colorful78306
Node: DIY Make completion matches more or less colorful79567
Node: DIY Make comments yellow and strings green83053
Node: DIY Make code syntax use the old alt-syntax style84757
Node: DIY Make use of alternative styles for code syntax87866
Node: DIY Make matching parenthesis more or less intense91327
Node: DIY Make box buttons more or less gray92696
Node: DIY Make TODO and DONE more or less intense93708
Node: DIY Make headings more or less colorful95205
Node: DIY Make Org block colors more or less colorful97319
Node: DIY Make Org agenda more or less colorful101688
Node: DIY Make inline code in prose use alternative styles104860
Node: DIY Make mail citations and headers more or less colorful107096
Node: DIY Make the region preserve text colors plus other styles109460
Node: DIY Make mouse highlights more or less colorful111014
Node: DIY Make language underlines less colorful112025
Node: DIY Make line numbers use alternative styles113175
Node: DIY Make diffs use only a foreground114816
Node: DIY Make deuteranopia diffs red and blue instead of yellow and blue117697
Node: DIY More accurate colors in terminal emulators120167
Node: DIY Range of color with terminal emulators121475
Node: DIY Per-theme customization settings124246
Node: DIY Do not extend the region background125679
Node: DIY Add padding to the mode line126476
Node: DIY Remap face with local value129401
Node: DIY Font configurations for Org and others131933
Ref: DIY Font configurations for Org and others-Footnote-1134915
Node: DIY Configure bold and italic faces135102
Node: DIY Custom Org todo keyword and priority faces139720
Node: DIY Custom Org emphasis faces143460
Node: DIY Use colored Org source blocks per language148331
Node: DIY Measure color contrast152970
Node: DIY Load theme depending on time of day155687
Node: DIY Backdrop for pdf-tools156714
Node: DIY Toggle themes without reloading them159870
Node: DIY Use more spacious margins or padding in Emacs frames161178
Node: DIY Custom hl-todo colors165410
Node: DIY Add support for solaire-mode167225
Node: DIY Add support for meow-mode170310
Node: DIY Add support for combobulate172120
Node: DIY Use a hook at the post-load-theme phase175743
Node: DIY A theme-agnostic hook for theme loading177970
Node: Build on top of the Modus themes180597
Node: Complete example of a Modus derivative theme186789
Node: Complete example of a package that is derived from Modus187793
Node: Complete example of a private theme derived from Modus190787
Node: Complete example of a custom theme with its own palette192407
Node: Complete example that also uses modus-themes-generate-palette197068
Node: Determine what counts as a Modus theme213789
Node: Create convenience commands to load a derivative theme217197
Node: Arrange to activate your derivative themes219464
Node: Face coverage221518
Node: Supported packages221982
Node: Indirectly covered packages227972
Node: Notes on individual packages229330
Node: Note on calendarel weekday and weekend colors230432
Node: Note on git-gutter in Doom Emacs231582
Node: Note on php-mode multiline comments234082
Node: Note on underlines in compilation buffers234844
Node: Note on inline Latex in Org buffers235718
Node: Note on dimmerel236329
Node: Note on display-fill-column-indicator-mode237814
Node: Note on highlight-parenthesesel239265
Node: Note on mmm-modeel background colors245322
Node: Note for prism247673
Node: Note on company-mode overlay pop-up250884
Ref: Note on company-mode overlay pop-up-Footnote-1251614
Ref: Note on company-mode overlay pop-up-Footnote-2251681
Node: Note on ERC escaped color sequences251736
Ref: Note on ERC escaped color sequences-Footnote-1253164
Node: Note on powerline or spaceline253274
Node: Note on SHR colors253690
Node: Note on SHR fonts254111
Node: Note on Ement colors and fonts254800
Node: Note on pdf-tools link hints256302
Node: Note on the Notmuch logo258760
Node: Note on goto-address-mode faces259294
Node: Frequently Asked Questions260414
Node: Is the contrast ratio about adjacent colors?261044
Node: What does it mean to avoid exaggerations?262549
Node: Why are colors mostly variants of blue magenta cyan?264399
Node: What is the best setup for legibility?268724
Node: Are these color schemes?271365
Node: Port the Modus themes to other platforms?275008
Node: Contributing277842
Node: Sources of the themes278241
Node: Issues you can help with278982
Node: Patches require copyright assignment to the FSF280257
Node: Acknowledgements282471
Node: GNU Free Documentation License287416
Node: Indices312579
Node: Function index312758
Node: Variable index317367
Node: Concept index321944

End Tag Table


Local Variables:
coding: utf-8
End:
