Compare commits

...

489 commits
4.8.1 ... main

Author SHA1 Message Date
Protesilaos f1ad6c9383
Reorganise the links to other Modus projects in the README.md and clarify I am not endorsing anybody's views 2026-09-07 11:39:25 +03:00
Protesilaos d7e30694cb
Mention omarchy-modus-themes by Dhavan Vaidya in the README.md 2026-09-06 15:38:17 +03:00
Protesilaos bcf065b803
Add support for log-view-marked face (Emacs 32)
I wrote a patch for it in emacs.git.
2026-09-04 16:49:03 +03:00
Protesilaos a3e7ba2805
Make all flymake EOL faces have the same :height 0.9 2026-09-01 12:44:05 +03:00
Protesilaos fd124dc370
Make read-multiple-choice-face use the style of keybindings plus :inverse-video
This is to make repeat-echo-message more consistent while also
accounting for the original use-case of this face where the
surrounding text is that of the minibuffer prompt (and may thus look
similar/identical to the keybindings).
2026-09-01 05:11:05 +03:00
Protesilaos 24e4b4b9e4
Make log-edit-headers-separator same as separator-line (Emacs bug#81753)
This is the same topic as with commit 2bae09f. Thanks again to Dmitry
Gutov for the suggestion: <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=81753>.
2026-08-31 19:13:17 +03:00
Protesilaos 2bae09feeb
Expand the separator-line style to work on TTY and graphics as needed (Emacs bug#81754)
Thanks to Dmitry Gutov for suggesting this in Emacs bug#81754:
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=81754>
2026-08-31 19:11:32 +03:00
Protesilaos 0f4d27dd96
Add missing :version and :package-version from some defface 2026-08-31 19:01:26 +03:00
Protesilaos 27a0ed0260
Make completion-preview-common also have an underline
It looks more consistent this way when we type something that goes
from completion-preview-common to completion-preview-exact.
2026-08-31 18:55:50 +03:00
Protesilaos 9a3cd56cc2
Include the modus-themes-common-palette-user in the resulting palette (Emacs bug#81640)
Thanks to Lucas Jimenez for reporting the bug on the Emacs bug tracker.
2026-08-29 22:26:55 +03:00
Protesilaos b86cace435
Cover query-replace-preview-match (Emacs 32)
This is to (i) only :inherit once and (ii) for me to remember this face.
2026-08-25 10:24:40 +03:00
Protesilaos 21ffe0cd5a
Mention peppers-theme by Joar von Arndt in the README.md 2026-08-24 12:10:46 +03:00
Protesilaos 75ad377135
Reword two statements in the manual 2026-08-19 23:03:37 +03:00
Protesilaos 8ebcedea65
Add support for query-replace-preview (Emacs 32) 2026-08-16 13:54:03 +03:00
Protesilaos 887af1139e
Add modus-vague by @paniash to the list of themes based on Modus 2026-08-13 14:07:23 +03:00
Protesilaos 52d4665bc5
Mention word-smith by @Sadsnake1 in the README.md
I was informed about it in issue 229:
<https://github.com/protesilaos/modus-themes/issues/229>.
2026-08-11 10:53:00 +03:00
Protesilaos 75aa3fa79e
Simplify the flymake end-of-line faces 2026-07-30 10:19:53 +03:00
Protesilaos 940249694c
Extend support for flycheck faces 2026-07-30 10:19:38 +03:00
Protesilaos 7d53a6959c
Add support for (setq magit-diff-use-indicator-faces t) 2026-07-22 10:11:54 +03:00
Protesilaos e81c3c6ce3
Remove two obsolete company-mode faces 2026-07-17 14:09:09 +03:00
Protesilaos 47dc463561
Clarify how Modus-related projects are listed in the README.md 2026-07-16 22:07:41 +03:00
Protesilaos 50b7a66423
Mention modus-alabaster by Derek Passen @dpassen in the project's README.md 2026-07-16 22:06:24 +03:00
Protesilaos 9a46f89607
Add TODO for more faces that I might want to bring back 2026-07-14 10:16:35 +03:00
Protesilaos 3c98eadc35
Bring back the Modus mark faces
Read the commit message of bf69c6c for the explanation.
2026-07-14 10:08:46 +03:00
Protesilaos 4bd5e91ee0
Add support for the synaxis package by Thanos Apollo 2026-07-14 09:41:05 +03:00
Protesilaos f2b88b4d7f
Simplify the faces I just reinstated 2026-07-14 09:18:30 +03:00
Protesilaos a1d081256e
Bring back the Modus search facesc
Read the commit message of bf69c6c for the explanation.
2026-07-14 09:12:22 +03:00
Protesilaos 0cf5a2a52a
Bring back the Modus completion faces
Read the commit message of bf69c6c for the explanation.
2026-07-14 09:04:23 +03:00
Protesilaos bf69c6cbcc
Bring back the modus-themes-prompt face
At some point I removed all the :inherit entries out of concern that
we would run into problems with circular dependencies (there was that
case with button and link inheriting each other, which recent Emacs
versions treat as an error).

With the Modus faces that can happen if the user configures things
accordingly or if I make some mistake here.

My plan now is to rely on Modus faces for cases such as this one, but
to not use :inherit for other faces, since I do not control how those
are defined.
2026-07-14 08:56:56 +03:00
Protesilaos 35586477b1
Add README.md reference to folio-theme by @kn66 2026-07-13 12:26:09 +03:00
Protesilaos 31e8394cb1
Acknowledge Heitor Augusto for commit 89e40be
This was done in pull request 225: <https://github.com/protesilaos/modus-themes/pull/225>.
The change is small, meaning that Heitor does not need to assign
copyright to the Free Software Foundation.
2026-07-12 12:27:59 +03:00
Protesilaos 21d97d4fe6
Remove trailing spaces from modus-themes--get-theme-palette-subr 2026-07-12 12:26:55 +03:00
Protesilaos 89294a9a6f
Merge pull request #225 from HeitorAugustoLN/patch-1
Improve core palette loading logic
2026-07-12 12:22:57 +03:00
Protesilaos f237b3ec47
Acknowledge Yuta Yamamoto for commit b3bd04a
This was done in pull request 227: <https://github.com/protesilaos/modus-themes/pull/227>.
The change is small, meaning that Yuta does not need to assign
copyright to the Free Software Foundation.
2026-07-12 12:19:58 +03:00
Protesilaos 61b5e30bb8
Merge pull request #227 from yutayamamoto/fix-auto-dim-face-names
Update auto-dim-other-buffers faces to their new names
2026-07-12 12:19:05 +03:00
Yuta Yamamoto b3bd04aca5 Update auto-dim-other-buffers faces to their new names
The package dropped the `-face' suffix: `auto-dim-other-buffers-face'
and `auto-dim-other-buffers-hide-face' are now obsolete aliases for
`auto-dim-other-buffers' and `auto-dim-other-buffers-hide'.
2026-07-08 15:13:27 +09:00
Protesilaos a69a3c80b6
Remove outdated reference to project mailing list
Thanks to Yuta Yamamoto for telling me about this in issue 226:
<https://github.com/protesilaos/modus-themes/issues/226>.
2026-07-07 23:08:48 +03:00
Heitor Augusto 89e40be4d8
Improve core palette loading logic
Enhance theme palette loading by ensuring core palette is loaded before accessing its value.
2026-07-06 21:17:13 +00:00
Protesilaos a071a9d8e7
Acknowledge Shawn LeMaster for commits c981ca6, 50c42fe, f28a5e5
These are part of pull request 224: <https://github.com/protesilaos/modus-themes/pull/224>.
2026-07-02 11:51:31 +03:00
Protesilaos a378446107
Merge pull request #224 from shlemas/main
Improve mapping coverage for modus-themes-generate-palette + tests
2026-07-02 11:50:20 +03:00
Protesilaos 9172a0e8ef
Add support for vc-dir-key-binding-hint-label (Emacs 32) 2026-06-28 13:42:10 +03:00
Shawn LeMaster f28a5e5931 Add missing quotes on color names 2026-06-27 22:12:59 -05:00
Shawn LeMaster 50c42fe90d Add more mappings to modus-themes-generate-palette + test 2026-06-27 17:42:40 -05:00
Shawn LeMaster c981ca60ae Add complete-palette-mappings test 2026-06-27 17:24:11 -05:00
Protesilaos c6a08aa1a8
Mention the modus-noric themes by Ashton Wiersdorf 2026-06-23 22:13:35 +03:00
Protesilaos 2d044ac89f
Update to modus-themes version 5.3.0 2026-06-21 16:25:01 +03:00
Protesilaos f97a9b0240
Mention pixel-themes by Lucas (@lucasobx) as project that builds on top of Modus 2026-06-16 09:28:44 +03:00
Protesilaos ef2fa82b12
Change read-multiple-choice-face to work with any combination of prompt colours 2026-05-22 10:20:20 +03:00
Protesilaos 87d5764ecc
Update elfeed faces to their new names
Thanks to Daniel Mendler for telling me about this change:
<https://github.com/emacs-elfeed/elfeed/pull/562#issuecomment-4511165960>.
2026-05-21 23:15:10 +03:00
Protesilaos c115002430
Change the fill-column-indicator background to unspecified
Thanks to vpxyz for telling me about the relevant warning. This was
done in issue 219: <https://github.com/protesilaos/modus-themes/issues/219>.
2026-05-19 13:38:17 +03:00
Protesilaos a47ed7af3f
Recompile the Info manual 2026-05-17 13:34:25 +03:00
Protesilaos 124ba3168e
Make fill-column-indicator appear a thin line also on TTY
I am doing this in response to issue 218, as reported by Mike Crowe:
<https://github.com/protesilaos/modus-themes/issues/218>.
2026-05-17 13:34:20 +03:00
Protesilaos c6bb5eb8df
Use the correct form to deprecate the modus-themes-prompt face 2026-05-08 23:29:53 +03:00
Protesilaos a4b6ada971
Deprecate the user option modus-themes-completions 2026-05-08 23:29:53 +03:00
Protesilaos 634dcc3245
Deprecate the user option modus-themes-prompts 2026-05-08 23:15:03 +03:00
Protesilaos c8925cd23b
Modify the manual about the version of the themes in Emacs 31
I wanted to get this done, but I had no time for it.
2026-05-07 20:39:44 +03:00
Protesilaos b242d43e6a
Make elfeed-show-entry-author-face conditionally bold 2026-05-06 08:27:53 +03:00
Protesilaos b4eca2c241
Add support for markdown-ts-mode 2026-05-05 22:40:37 +03:00
Protesilaos 806c894611
Add support for the margin face (Emacs 31) 2026-05-05 21:35:18 +03:00
Protesilaos 02a339ab2d
Mention my modus-themes-exporter in the README.md 2026-05-03 22:19:04 +03:00
Protesilaos c2be0f59b5
Rewrite the manual about modus-themes-mixed-fonts
Okay, this is enough for tonight. I still have a long way to go with this...
2026-05-03 22:11:42 +03:00
Protesilaos 211a72b708
Rewrite the manual about modus-themes-to-rotate 2026-05-03 22:03:44 +03:00
Protesilaos b7f64effe5
Rewrite the manual about modus-themes-to-toggle 2026-05-03 22:01:21 +03:00
Protesilaos 7c3c48b6dd
Rewrite the manual about modus-themes-italic-constructs 2026-05-03 21:59:03 +03:00
Protesilaos 1fc28ad804
Rewrite the manual about modus-themes-bold-constructs 2026-05-03 21:58:58 +03:00
Protesilaos 3ab7b22105
Rewrite the manual about modus-themes-disable-other-themes 2026-05-03 21:51:31 +03:00
Protesilaos 7f146f8826
Continue making stylistic changes to the manual 2026-05-03 21:45:36 +03:00
Protesilaos 5efd13653a
Merge pull request #217 from Stebalien/steb/elfeed
Add support for the new elfeed-show faces
2026-05-03 10:07:09 +03:00
Steven Allen 34c169a780 Add support for the new elfeed-show faces
The faces match the other elfeed faces where possible, and
notmuch/message faces otherwise (given that the elfeed interface is
inspired by notmuch).
2026-05-02 08:58:45 -07:00
Protesilaos 010ed94527
Start rewriting the manual
I will review the entire document, but this is enough for the evening.
2026-05-01 21:52:03 +03:00
Protesilaos 0164619a09
Be consistent about letter casing in the manual's Org PROPERTIES drawers 2026-05-01 20:18:09 +03:00
Protesilaos 8ebdc208ae
Mention in the README.md the Modus derivatives I am aware of 2026-05-01 20:01:25 +03:00
Protesilaos 2156e94a40
Same small rewording to the README.md 2026-05-01 20:01:13 +03:00
Protesilaos 15c77ce939
Update the test for modus-themes-wcag-formula
I prefer to have an error if the wrong colour is provided.
2026-05-01 17:44:49 +03:00
Protesilaos 0775c7ee92
Update test for modus-themes--hex-or-name-to-rgb
It is called differently now and also throws an error if it must.
2026-05-01 17:44:15 +03:00
Protesilaos c9c0974747
Write test for modus-themes-color-hex-p 2026-05-01 17:43:28 +03:00
Protesilaos cf0044518f
Deprecate modus-themes-generate-gradient and use modus-themes-adjust-value instead
They are meant to do the same thing.
2026-05-01 17:41:48 +03:00
Protesilaos 8d62a73f2a
Make modus-themes-adjust-value not depend on color-lighten-name
This is because that function relies on color-name-to-rgb which does
not seem to work in the early-init.el as reported by amano-kenji in
issue 215: <https://github.com/protesilaos/modus-themes/issues/215>.
2026-05-01 17:40:45 +03:00
Protesilaos 4b286c2b61
Change all HEX-COLOR parameters to COLOR in light of commit 488e913 2026-05-01 17:37:26 +03:00
Protesilaos 488e913b1e
Make helper function accept named colours as well as hex RGB
Otherwise we have a regression. Something like "gray50" is a valid
colour value (when list-colors-display returns it, anyway).
2026-05-01 17:35:30 +03:00
Protesilaos f71db69bad
Use "Protesilaos" instead of "Protesilaos Stavrou"
As I announced here: <https://protesilaos.com/news/2026-04-21-omitting-the-surname/>.
2026-04-24 13:27:23 +03:00
Protesilaos Stavrou 7c2ce1ff0d
Add support for the trust-manager package 2026-04-18 16:13:16 +03:00
Protesilaos Stavrou 7950791b52
Clarify the comment about evaluating user options before loading a theme 2026-04-17 22:51:55 +03:00
Protesilaos Stavrou 195011352e
Reword a heading in the manual 2026-04-17 22:49:56 +03:00
Protesilaos Stavrou a2c40a9f92
Add support for tab-line-active and tab-line-inactive faces (Emacs 31) 2026-04-17 12:42:03 +03:00
Protesilaos Stavrou 657fd6f92d
Make modus-themes-retrieve-palette-value public 2026-04-13 15:33:08 +03:00
Protesilaos Stavrou 9e87779b5e
Replace "doc string" with "docstring" 2026-04-13 08:45:14 +03:00
Protesilaos Stavrou ea87862946
Add a comment about the use of format in two tests 2026-04-12 18:46:25 +03:00
Protesilaos Stavrou 8635304365
Acknowledge Elias Gabriel Perez for commit 51c89ec
This was done in pull request 213: <https://github.com/protesilaos/modus-themes/pull/213>.

The change is small, meaning that Elias does not need to assign
copyright to the Free Software Foundation.
2026-04-10 23:44:16 +03:00
Protesilaos Stavrou ef4197d5ae
Merge pull request #213 from DevelopmentCool2449/main
Fix regression in mc/cursor-mc/cursor-bar-face
2026-04-10 23:43:14 +03:00
Elias Gabriel Perez 51c89ec604 * modus-themes.el (modus-themes-faces): Fix regression in mc/cursor-bar-face 2026-04-10 13:02:56 -06:00
Protesilaos Stavrou 4ca21529ae
Make stylistic tweaks to modus-themes-test--define-test (mtt-define-test) 2026-04-10 21:39:21 +03:00
Protesilaos Stavrou 704edc5af3
Update the "Author:" field in modus-themes-test.el 2026-04-10 21:33:18 +03:00
Protesilaos Stavrou 551f4254c8
Acknowledge Benjamin Kästner for commit 44cc370
This was done in pull request 212: <https://github.com/protesilaos/modus-themes/pull/212>.

The change is within the ~15-line limit for non-trivial changes,
meaning that Benjamin does not need to assign copyright to the Free
Software Foundation.
2026-04-10 21:30:37 +03:00
Protesilaos Stavrou 44cc370313
Merge pull request #212 from bkaestner/main
Make DOCSTRING in mtt-define-test optional
2026-04-10 21:29:03 +03:00
Benjamin Kästner f90869584a Remove explicit optional DOCSTRING `nil's
The explicit `nil's actually don't break the previously introduced
functionality. As (stringp nil) is `nil', it was interpreted as a
missing DOCSTRING.

However, they now contain only noise.
2026-04-10 18:29:24 +02:00
Benjamin Kästner 742054c713 Make DOCSTRING in mtt-define-test optional
This commit removes mtt-define-test's explicit DOCSTRING argument and
instead inspects the first entry of the given ARGS:

- if (car args) is a string, it is interpreted as a DOCSTRING
- otherwise, it is considered to be part of the test's BODY

Examples:

;; No docstring
(macroexpand-1
 '(mtt-define-test trivial-check
    (should (= 1 1))))
=> (ert-deftest mtt-trivial-check nil "Test that `trivial-check' does the right thing." (should (= 1 1)))

;; With docstring
(macroexpand-1
 '(mtt-define-test trivial-check-with-docstring
    "This tests a trivial thing."
    (should (= 1 1))))
=> (ert-deftest mtt-trivial-check-with-docstring nil "This tests a trivial thing." (should (= 1 1)))

mtt-define-test's own docstring follows the usual \(fn ARGLIST)
feature used for macros, see "(elisp) Function Documentation".
2026-04-10 18:29:24 +02:00
Protesilaos Stavrou 0217c0dde5
Refine modus-themes--color-eight-to-six-digits
Thanks to Stefan Monnier for pointing this in a message to the
emacs-devel mailing list: <https://lists.gnu.org/archive/html/emacs-devel/2026-04/msg00358.html>.
2026-04-10 18:57:57 +03:00
Protesilaos Stavrou 8a8ed85ae7
Make stylistic change to the test of modus-themes-sort 2026-04-10 16:26:12 +03:00
Protesilaos Stavrou d2f64a8a4f
Write test for modus-themes-sort 2026-04-10 16:24:52 +03:00
Protesilaos Stavrou f430f287bd
Write macro to express tests how I want them 2026-04-10 16:24:38 +03:00
Protesilaos Stavrou ec4c79c472
Write test for modus-themes--background-p 2026-04-10 15:59:50 +03:00
Protesilaos Stavrou 087b419503
Write a test for modus-themes--belongs-to-family-p 2026-04-10 15:57:36 +03:00
Protesilaos Stavrou d76bbf9865
Write test for modus-themes--belongs-to-family-p 2026-04-10 15:55:31 +03:00
Protesilaos Stavrou dce91510b3
Write test for modus-themes-activate 2026-04-10 15:37:29 +03:00
Protesilaos Stavrou df74b73a60
Write a test for modus-themes--color-eight-to-six-digits and use its name instead of the older symbol 2026-04-10 14:58:24 +03:00
Protesilaos Stavrou 282dbd66b5
Improve modus-themes-adjust-value and write a test for it 2026-04-10 14:58:06 +03:00
Protesilaos Stavrou b31966fe65
Change name of ancillary function to be more precise and refine its implementation 2026-04-10 14:57:36 +03:00
Protesilaos Stavrou c63be80d3b
Refine modus-themes-contrast and write a test for it 2026-04-10 14:48:51 +03:00
Protesilaos Stavrou 953ec93841
Refine modus-themes-wcag-formula and write a test for it 2026-04-10 14:48:14 +03:00
Protesilaos Stavrou f062c8d99a
Write a test for modus-themes--hex-to-rgb 2026-04-10 14:21:18 +03:00
Protesilaos Stavrou a134889772
Add missing parenthesis to a doc string 2026-04-10 14:16:29 +03:00
Protesilaos Stavrou 2e19f038c3
Update the modus-themes--hex-to-rgb doc string 2026-04-10 14:03:51 +03:00
Protesilaos Stavrou 6fa9f61f48
Fix current year in modus-themes-test.el 2026-04-10 12:55:59 +03:00
Protesilaos Stavrou dbd67e1140
Update the modus-themes-test.el copyright years 2026-04-10 12:49:08 +03:00
Protesilaos Stavrou 937ee8047b
Make stylistic change to modus-themes--hex-to-rgb 2026-04-10 12:45:32 +03:00
Protesilaos Stavrou 7d234fd65f
Make blink-matching-paren-offscreen the same as show-paren-match
Thanks to Troy Brown for suggesting this change in issue 209:
<https://github.com/protesilaos/modus-themes/issues/209>.
2026-04-05 21:15:09 +03:00
Protesilaos Stavrou b07a5d5001
Reinstate 'provide' in all theme files
I thought this was not needed, but Ihor Radchenko showed me a useful
example. This was done in issue 207: <https://github.com/protesilaos/modus-themes/issues/207>.
2026-04-05 16:33:11 +03:00
Protesilaos Stavrou 9492b9e3fa
Mention modus-themes.nvim in the README.md
A project by @miikanissi.
2026-04-05 16:26:38 +03:00
Protesilaos Stavrou 0a6f5d33a3
Mention zed-modus-themes in the README.md
A project by @vitallium.
2026-04-05 16:24:20 +03:00
Protesilaos Stavrou d763988f80
Mention hugo-modus in the README.md
I am putting it here instead of the manual. The latter is synchronised
with emacs.git and I do not want to have any issues about mentioning
projects that may not be in line with GNU policy.
2026-04-05 16:16:54 +03:00
Protesilaos Stavrou 84528d1f3e
Refine the typst-ts-script-char-face to use bold conditionally
This is about the user option modus-themes-bold-constructs.
2026-04-05 15:53:21 +03:00
Protesilaos Stavrou 5e69da089a
Make font-latex-script-char-face look like escape-glyph 2026-04-05 15:52:37 +03:00
Protesilaos Stavrou bbb43a6f62
Add initial support for typst-ts-mode
Thanks to Pranshu Sharma for making this suggestion in issue 208:
<https://github.com/protesilaos/modus-themes/issues/208>.
2026-04-05 15:52:05 +03:00
Protesilaos Stavrou e0f42f2740
Extend support for my lin package faces 2026-03-25 10:09:07 +02:00
Protesilaos Stavrou e5fb7f2229
Update the manual's acknowledgements for commit 83501bc 2026-03-20 08:17:15 +02:00
Protesilaos Stavrou 83501bcd50
Correct the modus-themes-toggle behaviour to match its doc string
I want to prompt for a theme only if modus-themes-to-toggle is not
right.

Thanks Morten Kjeldgaard for bringing this matter to my attention in
issue 44 in the ef-themes repository (those are built on top of the
modus-themes): <https://github.com/protesilaos/ef-themes/issues/44>.
2026-03-20 08:15:02 +02:00
Protesilaos Stavrou 5e1621d638
Make the breadcrumb faces inherit from their base face
This way users can apply, say, a font height that carries over to all
the faces.

Thanks to baconabo for making this suggestion in issue 204:
<https://github.com/protesilaos/modus-themes/issues/204>.
2026-03-16 20:17:51 +02:00
Protesilaos Stavrou c865abc82d
Remove blank line 2026-03-15 21:48:02 +02:00
Protesilaos Stavrou 30cbfe27b5
Consolidate some colours in the modus-themes-common-palette-mappings 2026-03-15 21:47:09 +02:00
Protesilaos Stavrou 6beea7125e
Define new bg-popup named colour
This gives users and derivative themes the option to pick a suitable
value for those interfaces.

Thanks to aikrahguzar for making this suggestion in issue 70 of my
ef-themes repository (the ef-themes are built on top of the
modus-themes): <https://github.com/protesilaos/ef-themes/issues/70>.
2026-03-15 21:28:05 +02:00
Protesilaos Stavrou 100533ab0f
Remove background value from company-preview face
This makes it consistent with the style I am applying to the built-in
completion-preview-mode.
2026-03-15 21:28:02 +02:00
Protesilaos Stavrou a4264088b7
Make modus-themes-adjust-value return 6-digit colour 2026-03-14 10:57:29 +02:00
Protesilaos Stavrou ed36e34132
Bring back the modus-themes-adjust-value
Derivative themes may need it.
2026-03-08 21:43:54 +02:00
Protesilaos Stavrou cb20bbe83f
Remove needless comment 2026-03-08 21:30:46 +02:00
Protesilaos Stavrou 9d0226961d
Include the featurep check in modus-themes-theme
This is because our check involves this:

    (let ((theme-exists-p (get name 'theme-feature)) ...) ...)

Thanks to Daniel Colascione for informing me about this in issue 201:
<https://github.com/protesilaos/modus-themes/issues/201>.
2026-03-01 12:07:59 +02:00
Protesilaos Stavrou 789cb7ea32
Revert "Add back theme-autoload cookies to all theme files"
This reverts commit b2e0aff5ed.

It does not work as intended, as reported by Daniel Colascione in
issue 202: <https://github.com/protesilaos/modus-themes/issues/202>. I
will need to make a wider revision here.
2026-03-01 12:05:46 +02:00
Protesilaos Stavrou b45b0d8a7c
Only disable 'color-schemes' with modus-themes-disable-other-themes
This is because Emacs 31 comes with a "newcomer" theme that we do not
want to disable by mistake.
2026-02-22 08:43:39 +02:00
Protesilaos Stavrou ecd696daf8
Add support for my institution-calendar faces 2026-02-20 08:58:50 +02:00
Protesilaos Stavrou b2e0aff5ed
Add back theme-autoload cookies to all theme files
I tried to do this with a recent commit but that broke things because
I also included a deftheme declaration. Having that meant that
modus-themes-theme would not declare the theme with all its data,
including its palette.

I looked at loaddefs-generate--emacs-batch and it seems that having
just the theme-autoload line is enough.
2026-02-19 08:43:20 +02:00
Protesilaos Stavrou 1343ea9947
Revert "Reinstate the theme-autoload cookie with the deftheme in place"
This reverts commit 122d53333f.

The reason is that this breaks the package when trying to load a theme
at startup. This was reported by Eamonn Sullivan in issue 69 in the
ef-themes repository: <https://github.com/protesilaos/ef-themes/issues/69>.
2026-02-18 20:44:05 +02:00
Protesilaos Stavrou 122d53333f
Reinstate the theme-autoload cookie with the deftheme in place
We need this because otherwise the autolaods are not generated
properly, which can cause problems for other packages that need to
read the theme data.
2026-02-18 18:48:27 +02:00
Protesilaos Stavrou 127ed57f0e
Remove magit face that does not exist anymore 2026-02-17 09:26:40 +02:00
Protesilaos Stavrou 9dd3b9074b
Acknowledge Mike Olson for commit c475454
This is what allows the modus-themes to be loaded in the early-init.el
because they no longer depend on color-name-to-rgb to be available at
that time.

This change was done in pull request 199: <https://github.com/protesilaos/modus-themes/pull/199>.
It is within the ~15-line limit, meaning that Mike does not need to
assign copyright to the Free Software Foundation.
2026-02-17 09:15:57 +02:00
Protesilaos Stavrou 9af856fb38
Merge pull request #199 from mwolson/fix/color-values-display-independence
Use color-values-from-color-spec instead of color-name-to-rgb
2026-02-17 09:13:13 +02:00
Mike Olson c475454d87 Use color-values-from-color-spec instead of color-name-to-rgb
Replace `color-name-to-rgb' with a new internal helper
`modus-themes--hex-to-rgb' that uses `color-values-from-color-spec'
(a C built-in since Emacs 28.1) to parse hex RGB strings without
any display dependency.

This fixes a crash when loading a Modus theme during early-init.el
on GUI Emacs (e.g. macOS Homebrew emacs-plus), where
`color-name-to-rgb' fails because `color-values' returns nil before
the display is ready.

The fix applies to all three direct call sites:
- `modus-themes-wcag-formula' (the critical one, called during
  theme loading)
- `modus-themes-generate-color-blend'
- `modus-themes-color-warm-p'

Fixes #198.
2026-02-16 15:04:35 -05:00
Protesilaos Stavrou 0ace30e471
Write tests for dark colour and readable colour 2026-01-31 10:14:40 +02:00
Protesilaos Stavrou b633768b7c
Rewrite mtt-inheritance test to restore the current Modus theme 2026-01-31 10:13:45 +02:00
Protesilaos Stavrou ea135519d3
Revert to using a readable foreground for the org-habit faces
This relies on our own functions, which should be available even if
the theme is loaded via the early-init.el.

Thanks to Jacod "Jake" Gordon for reminding me to fix this and for
testing my prototype. It was done in issue 197:
<https://github.com/protesilaos/modus-themes/issues/197>.
2026-01-31 10:00:35 +02:00
Protesilaos Stavrou 27456c3121
Change modus-themes--list-colors-tabulated to use our own function for a readable foreground (commit 2c225b6) 2026-01-31 10:00:07 +02:00
Protesilaos Stavrou 2c225b634e
Define function to get readable foreground, based on our own "dark-p" (per commit 4ecefd9) 2026-01-31 09:59:34 +02:00
Protesilaos Stavrou 4ecefd924f
Implement our own "dark-p" which relies on our WCAG formula test
This way I can more easily reason about the return value.
2026-01-31 09:58:21 +02:00
Protesilaos Stavrou 4b4fd65336
Change the parameter name in a couple of places to suggest it is a hexadecimal RGB colour 2026-01-31 09:56:45 +02:00
Protesilaos Stavrou 39682cd87c
Make stylistic changes to the WCAG formula functions 2026-01-31 09:56:13 +02:00
Protesilaos Stavrou ba747a245f
Change the scroll-bar background to ensure better visibility 2026-01-25 08:59:38 +02:00
Protesilaos Stavrou 0f6ce4f8bb
Remove the box and background from the completion group titles and make them optionally italic 2026-01-24 10:18:37 +02:00
Protesilaos Stavrou c57f158886
Only use bold in org-list-dt
The reason is that the foreground overrides other foregrounds, such as
for ~code~ elements.
2026-01-23 09:32:51 +02:00
Protesilaos Stavrou 55be658ddf
Use a background and box for the completion groups 2026-01-21 08:55:00 +02:00
Protesilaos Stavrou 8a45a1393a
Tweak the format of the modus-themes-with-colors error message 2026-01-13 06:31:26 +02:00
Protesilaos Stavrou 4d9a19513d
Update the copyright years 2026-01-11 12:45:54 +02:00
Protesilaos Stavrou 192b2f612e
Go back to using a "success" colour for git commit summary lines
This is because it is the only colour that is guaranteed to contrast
with the warning and error colours we use for long lines and non-empty
second line.
2026-01-10 07:57:30 +02:00
Protesilaos Stavrou 0b6956a783
Be more strict about how to check for loaded theme
This is because typically themes have a 'provide-theme' in their file,
which we do not have in our theme files. Not doing a 'provide-theme'
at all times can break user configurations.

Thanks to Daniel Colascione for pointing this out in issue 195:
<https://github.com/protesilaos/modus-themes/issues/195>.
2026-01-10 07:51:08 +02:00
Protesilaos Stavrou 073e1d2488
Remove outdated comment 2026-01-09 07:11:35 +02:00
Protesilaos Stavrou afe5c14f30
Acknowledge Steven Allen for commit e22df92
This was done in pull request 194: <https://github.com/protesilaos/modus-themes/pull/194>.
Steven has assigned copyright to the Free Software Foundation.
2026-01-09 07:03:49 +02:00
Protesilaos Stavrou 8f05f03bc9
Merge pull request #194 from Stebalien/steb/fix-gradients
Lighten/darken colors in a specified direction instead of guessing
2026-01-09 07:01:09 +02:00
Steven Allen e22df9248c Lighten/darken colors in a specified direction instead of guessing
Previously, we'd sometimes specify a direction, but then we'd guess the
direction again `modus-themes-generate-gradient'. This commit removes
that guess and specifies the direction explicitly in all cases.

fixes https://github.com/protesilaos/ef-themes/issues/65
2026-01-08 09:48:03 -08:00
Protesilaos Stavrou be8111f267
Acknowledge ukiran03 for commit 7eeadab
This was done in pull request 193:
<https://github.com/protesilaos/modus-themes/pull/193>.

The change is small, meaning that ukiran03 does not need to assign
copyright to the Free Software Foundation.
2026-01-08 18:36:44 +02:00
Protesilaos Stavrou 7eeadab5d8
Merge pull request #193 from ukiran03/widget-field-underline
Set widget-field underline face to border color
2026-01-08 18:35:38 +02:00
Protesilaos Stavrou e438a2fcdc
Acknowledge JD Smith for commit e8dee25
This was done in pull request 191: <https://github.com/protesilaos/modus-themes/pull/191>.
2026-01-08 06:46:35 +02:00
Protesilaos Stavrou b38aaf265f
Merge pull request #191 from jdtsmith/with-colors-symbol-macrolet
Rewrite modus-themes-with-color to use cl-symbol-macrolet
2026-01-08 06:45:36 +02:00
ukiran03 f5df8edd15 Set widget-field underline face to border color
The widget-field underline inherits the foreground color by default.
This change ensures it uses the border face for better visual
consistency.

Fixes: https://github.com/protesilaos/modus-themes/issues/192
2026-01-05 10:13:32 +05:30
JD Smith e8dee25bd6 Rewrite modus-themes-with-color to use cl-symbol-macrolet
To address bugs associated with real color vs. mapped color ordering
and other issues, we swap the let* form construction for
cl-symbol-macrolet.
2026-01-04 09:37:20 -05:00
Protesilaos Stavrou 53fa9fd23d
Document how users can configure vc-annotate colours 2026-01-03 07:55:35 +02:00
Protesilaos Stavrou 3247c5d0f7
Add support for the faces of my pulsar package
Their colours are consistent with Modus by default, but they will not
necessarily look right in Modus derivatives.
2026-01-02 12:48:46 +02:00
Protesilaos Stavrou d1a9fbb4e6
Add support for the faces of my lin package
Their colours are consistent with Modus by default, but they will not
necessarily look right in Modus derivatives.
2026-01-02 12:47:00 +02:00
Protesilaos Stavrou 5b4747748e
Port emacs.git commit e09990891ffac9fa20385a8a38a18edf2e27d246
This is done by Eshel Yaron, as discussed on the mailing list:
<https://lists.gnu.org/archive/html/emacs-devel/2026-01/msg00011.html>.
2026-01-02 11:33:54 +02:00
Protesilaos Stavrou d1037f1322
Update to modus-themes version 5.2.0 2025-12-31 10:34:19 +02:00
Protesilaos Stavrou fc20e2bf7a
Cover the xref-file-header face 2025-12-28 11:28:54 +02:00
Protesilaos Stavrou 89185784ea
Fix typo in doc string 2025-12-28 08:31:47 +02:00
Protesilaos Stavrou 6dcd369037
Use a higher luminance value for modus-themes-generate-gradient 2025-12-23 07:58:45 +02:00
Protesilaos Stavrou cd01e5ead6
Use shorthands in the tests' file 2025-12-23 07:17:20 +02:00
Protesilaos Stavrou d673df22ca
Make small tweaks to modus-themes-test-inheritance 2025-12-23 07:06:55 +02:00
Protesilaos Stavrou 46d4b49266
Update the manual on account of commit 7a86cf4 2025-12-19 15:06:58 +02:00
Protesilaos Stavrou 7a86cf49a8
Revise modus-themes-with-colors to work with dynamic variables
This is how it used to be. I am addressing a regression that was
introduced in Modus themes version 5.0.0.

Thanks to Alexandr Semenov and realazy for testing my patch in issue
170: <https://github.com/protesilaos/modus-themes/issues/170>.
2025-12-19 15:04:34 +02:00
Protesilaos Stavrou 4ac7fdd6c7
Rewrite the completion table and expand it with group and display sort functions 2025-12-13 04:56:09 +02:00
Protesilaos Stavrou c8a6aa6998
Apply a faint foreground to marginalia-file-name 2025-12-13 04:55:29 +02:00
Protesilaos Stavrou 03c716e5bb
Merge pull request #189 from basil-conto/blc/spell
Fix some docstring typos
2025-12-11 08:44:16 +02:00
Protesilaos Stavrou cb99f74bc9
Merge pull request #188 from rudolf-adamkovic/main
Fix incorrect face inheritance affecting AUCTeX
2025-12-11 08:44:05 +02:00
Protesilaos Stavrou 0358a2a460
Merge pull request #190 from basil-conto/blc/push
Minor logic simplifications
2025-12-11 08:42:51 +02:00
Basil L. Contovounesios 83670578ea
Minor logic simplifications
Prefer push over add-to-list when membership equal-ity is not
needed.  Simplify some boolean expressions.
2025-12-09 14:06:08 +01:00
Basil L. Contovounesios e1154773ce
Fix some docstring typos 2025-12-09 13:56:01 +01:00
Rudolf Adamkovič 9649a18f69 Fix incorrect face inheritance affecting AUCTeX 2025-12-08 14:35:29 +01:00
Protesilaos Stavrou 64735b7df0
Remove duplicate entries for faces
Thanks to Basil L. Contovounesios for pointing this out in issue 185:
<https://github.com/protesilaos/modus-themes/issues/185>.
2025-12-06 09:59:42 +02:00
Protesilaos Stavrou 703dad8fd1
M-x untabify and then re-indent the buffer 2025-12-06 09:46:09 +02:00
Protesilaos Stavrou 582f53b07b
Add doc string to modus-themes--modus-theme-p 2025-12-06 09:45:36 +02:00
Protesilaos Stavrou 175a519494
Tweak the adjustment for derivative backgrounds in modus-themes-generate-palette and add TODO about it 2025-12-06 09:39:44 +02:00
Protesilaos Stavrou 53f461b397
Merge pull request #184 from PierreTechoueyres/main
Fix modus-themes-toggle and modus-themes--disable-themes
2025-12-03 09:54:14 +02:00
Pierre Téchoueyres 725bf50aba Fix modus-themes-toggle by using modus-themes-get-current-theme 2025-12-02 21:53:03 +01:00
Pierre Téchoueyres bf9dfed400 Add modus-themes--modus-theme-p predicate.
Rewrite modus-themes-get-current-theme and modus-themes--disable-themes to use it
2025-12-02 21:51:18 +01:00
Pierre Téchoueyres 7d06212953 Fix modus-themes--disable-themes to follow modus-themes-disable-other-themes
Disable themes of the modus collection when the value of the variable
is nil as stated in the docstring.
2025-12-02 21:47:30 +01:00
Protesilaos Stavrou 3cc6f7fec2
Implement a completions group-function and use unique category 2025-12-02 05:24:44 +02:00
Protesilaos Stavrou 2c901c9969
Make derived modus-themes-define-derivative-command doc strings a bit shorter 2025-11-30 19:00:56 +02:00
Protesilaos Stavrou c41281151f
Adjust the intensity of the derived coloured backgrounds in modus-themes-generate-palette 2025-11-29 07:13:07 +02:00
Protesilaos Stavrou b238abe7fc
Remove one mapping from modus-themes-generate-palette
It will be inherited from the underlying core palette. Styling this
here is not important.
2025-11-29 07:12:53 +02:00
Protesilaos Stavrou bcaf0835fd
Require color.el at all times
This is because other packages may use some of the color-related
functions we provide without calling modus-themes-generate-palette.
2025-11-29 07:12:39 +02:00
Protesilaos Stavrou 117875cb12
Rewrite modus-themes-get-current-theme to work with many custom-enabled-themes
Thanks to Pierre Téchoueyres for reporting the scenario where multiple
other themes are loaded on top of a Modus theme. This was done in
issue 182: <https://github.com/protesilaos/modus-themes/issues/182>.
2025-11-28 07:41:48 +02:00
Protesilaos Stavrou 2a32f92782
Remove obsolete argument from one modus-themes-get-current-theme call (see commit 7076680) 2025-11-26 18:47:28 +02:00
Protesilaos Stavrou 7076680932
Remove logic of theme loading from modus-themes-get-all-known-themes
It has no business there. This is something I used to do long ago and
I tried to keep it for the upgrade to version 5.0.0. I believe we are
safe without it, but I guess we will find out.
2025-11-26 18:34:38 +02:00
Protesilaos Stavrou 344946ac0e
Make modus-themes-activate load a theme if we cannot operate on it
Annotate the code to better communicate intent.
2025-11-26 18:31:22 +02:00
Protesilaos Stavrou f4474129e6
Simplify how modus-themes-generate-palette falls back to cool or warm preference 2025-11-26 13:07:03 +02:00
Protesilaos Stavrou 1ee7c20971
Fix modus-themes-generate-palette old assumption about the six accent colours
This was fine when I originally implemented it, but then I changed
some other parts and forgot to update this one...
2025-11-26 13:06:27 +02:00
Protesilaos Stavrou ffdee3a436
Tweak a couple of derived mappings in modus-themes-generate-palette 2025-11-26 07:19:20 +02:00
Protesilaos Stavrou fdcbb99be2
Use the correct foreground for org-dispatcher-highlight and make it bold unconditionally 2025-11-26 06:33:30 +02:00
Protesilaos Stavrou 6fc7630666
Document how to activate derivative themes 2025-11-26 06:30:22 +02:00
Protesilaos Stavrou fc3783e5d3
Also autoload modus-themes-activate 2025-11-26 06:23:38 +02:00
Protesilaos Stavrou dbbfff6582
Make modus-themes-activate a public function
I plan to mention it in the manual.
2025-11-26 06:16:57 +02:00
Protesilaos Stavrou 0958eb8e48
Reduce all generated colors to 6 digits (see commit 1129cf5) 2025-11-26 06:04:43 +02:00
Protesilaos Stavrou 1129cf5f92
Define helper to reduce a color from 4 digits per triplet to 2 2025-11-26 06:04:00 +02:00
Protesilaos Stavrou ecfd90d430
Make copy of color-blend because we need it for older versions 2025-11-26 06:03:09 +02:00
Protesilaos Stavrou 7bfc18d130
Be consistent with the terminology I am using in one comment
I have "cool" elsewhere, so better not confuse people.
2025-11-25 16:00:34 +02:00
Protesilaos Stavrou 3b0bbaa779
Simplify modus-themes-color-warm-p
Thanks to Stefan Monnier for pointing this out on the emacs-devel
mailing list: <https://lists.gnu.org/archive/html/emacs-devel/2025-11/msg00996.html>.

It is what I was trying to do before with 'color-distance', per the
comment right above:

    ;; NOTE 2025-11-25: I used to rely on `color-distance', thinking that
    ;; it would do the right thing here:
    ;;
    ;;     (> (color-distance color "#ff0000") (color-distance color "#0000ff"))
    ;;
    ;; But my understanding of "warm" versus "cold" is simple, so better
    ;; do it my way.

But I did not originally see the simpler modus-themes-color-warm-p, so here we are!
2025-11-25 14:15:40 +02:00
Protesilaos Stavrou 01080b292b
Rewrite modus-themes--activate for clarity 2025-11-25 13:13:58 +02:00
Protesilaos Stavrou 1d0348fc64
Stop hardcoding colour values for the three Gnus mail groups 2025-11-25 12:48:54 +02:00
Protesilaos Stavrou c2cf943239
Simplify the test for warm or cool preference (see commit d0f1537) 2025-11-25 10:54:41 +02:00
Protesilaos Stavrou d0f1537f95
Implement modus-themes-color-warm-p because color-distance fails to do what I assumed 2025-11-25 10:54:15 +02:00
Protesilaos Stavrou 1a346f825b
Refine how we disable other themes
We do not need to actually disable other Modus themes because their
palettes have the same entries, so the active theme will anyway take
effect over the others. And if another Modus theme has more colours in
its palette, then the user probably wants to keep those around.
2025-11-25 09:00:09 +02:00
Protesilaos Stavrou 7f5e40060a
Also cover the identifier mapping in modus-themes-generate-palette 2025-11-25 08:50:56 +02:00
Protesilaos Stavrou a8583fae4e
Cover new search mappings in modus-themes-generate-palette (see commit cf8cc86) 2025-11-25 08:47:59 +02:00
Protesilaos Stavrou cf8cc86afc
Implement semantic mappings for search-related foregrounds
By the way, I love occur+kmacros! All these changes are so easy to make.
2025-11-25 08:41:09 +02:00
Protesilaos Stavrou b48837de67
Add yet more mappings to modus-themes-generate-palette 2025-11-25 08:24:02 +02:00
Protesilaos Stavrou 0088add0ad
Make modus-themes-generate-palette define more mappings 2025-11-25 08:17:20 +02:00
Protesilaos Stavrou e49b1e0248
Reword some parts of the section about modus-themes-generate-palette 2025-11-25 07:41:56 +02:00
Protesilaos Stavrou c15eea4125
Write the manual's detailed guide for modus-themes-generate-palette
We can always refine the implementation details, but at least the
results are looking very promising. I think/hope users will benefit
from this enhancement.
2025-11-24 19:39:38 +02:00
Protesilaos Stavrou 80db306ddb
Update the modus-themes-generate-palette doc string 2025-11-24 17:39:56 +02:00
Protesilaos Stavrou ec8f8a80b1
Conditionally push to mappings in modus-themes-generate-palette
I think this is done now. All that remains is to (i) polish the
derived colors because some of them are not nice and (ii) check the
code again to make sure I am not being sloppy.
2025-11-24 14:51:04 +02:00
Protesilaos Stavrou 4694dc5a8b
Resolve the duplicates and prioritisation in modus-themes-generate-palette 2025-11-24 14:49:25 +02:00
Protesilaos Stavrou 78e79d3eba
Reindent modus-themes-generate-palette 2025-11-24 14:18:08 +02:00
Protesilaos Stavrou 2c85a495cb
Push a derived colour only if needed in modus-themes-generate-palette
I want to do the same for the mappings, but I will have to go soon...
2025-11-24 14:13:22 +02:00
Protesilaos Stavrou 24d426e59b
Use cadr not cdr in modus-themes-generate-palette 2025-11-24 14:08:21 +02:00
Protesilaos Stavrou ed618c1050
Add two error checks for the type of modus-themes-generate-palette arguments 2025-11-24 13:54:41 +02:00
Protesilaos Stavrou 51dd0362b9
Fix a typo 2025-11-24 13:54:33 +02:00
Protesilaos Stavrou 1a7867074e
Make modus-themes-generate-palette require at bg-main and fg-main 2025-11-24 13:48:16 +02:00
Protesilaos Stavrou feecb71130
Make modus-themes-generate-palette accept optional mappings and refine its internals
I wrote those changes earlier, but then forgot to commit. Then I came
back and accidentally reverted/destroyed what I had... This is going
off of memory, but I will need to check again.
2025-11-24 13:41:05 +02:00
Protesilaos Stavrou 0730b28045
Add missing fullstop in first line of modus-themes-generate-palette doc string 2025-11-24 12:08:46 +02:00
Protesilaos Stavrou a416bc4906
Add missing autoload for modus-themes-generate-palette 2025-11-24 12:08:38 +02:00
Protesilaos Stavrou 823d31d19b
Use optional preference for modus-themes-generate-palette 2025-11-24 07:37:53 +02:00
Protesilaos Stavrou 72bf76eb84
Define prototype of modus-themes-generate-palette
I will document it later. First I want to make sure it works decently.
2025-11-24 07:18:19 +02:00
Protesilaos Stavrou ef3e513dfe
Add the missing registration of derivative themes in modus-themes-theme 2025-11-24 07:17:49 +02:00
Protesilaos Stavrou 5af03b7294
Add comment about doing something like modus-themes--box for some underlines 2025-11-23 18:34:17 +02:00
Protesilaos Stavrou 23e443a016
Pass correct attributes when ':box (:color unspecified)'
We have to make sure that the value passed to :color is not
'unspecified'. Users may want to do this, given the option they have
via the overrides, and it is a fine use of the system. Internally
though, we have to adjust the :box to do the right thing instead of
throwing an error.

Thanks to JD Smith for reporting a bug along those lines in issue 9 of
my standard-themes repo (they are derived from the modus-themes, hence
the changes here): <https://github.com/protesilaos/standard-themes/issues/9>.
I am generalising the fix for all faces that could exhibit the same
problem. I will check if we need to do the same for some of the underlines.
2025-11-23 18:21:15 +02:00
Protesilaos Stavrou a472f54645
Update modus-themes-define-derivative-command-known-suffixes to include select-{dark,light} 2025-11-22 16:48:12 +02:00
Protesilaos Stavrou c270cd8f5e
Implement convenience commands modus-themes-select-{dark,light} 2025-11-22 14:15:36 +02:00
Protesilaos Stavrou 26d60d3e6b
Disambiguare calendar-today from org-date-selected
This is because both can appear in the same context, whereas I thought
this would never happen.

Thanks to Rudolf Adamkovič for discussing this with me in the context
of the same change for my doric-themes (issue 20):
<https://github.com/protesilaos/doric-themes/issues/20>.
2025-11-22 11:41:47 +02:00
Protesilaos Stavrou 53717d1607
Support transient-semantic-coloring (also see commit 81862df) 2025-11-19 07:29:04 +02:00
Protesilaos Stavrou 81862dfa99
Define modus-themes-faces-deuteranopia and modus-themes-faces-tritanopia
These are meant to be applied as a deviation from modus-themes-faces,
as they are specific to the needs of users with the given colour deficiency.
2025-11-19 07:28:04 +02:00
Protesilaos Stavrou 065fbe15e7
Remove transient named colour faces that do not exist anymore 2025-11-19 07:27:26 +02:00
Protesilaos Stavrou 2602e2c0db
Use more appropriate style for completion-preview-exact and add note about it 2025-11-18 19:30:35 +02:00
Protesilaos Stavrou 3ddb82b37b
Add explicit support for the built-in completion-preview-mode faces
We want to do this because completion-preview-exact hardcodes a colour
value, which does not work for our purposes.

Thanks to Kevin Fleming for asking me about this in issue 178:
<https://github.com/protesilaos/modus-themes/issues/178>.
2025-11-18 12:38:20 +02:00
Protesilaos Stavrou f79684961e
Use optional bold weight for hl-todo faces
This is how we were doing it before until I undid it by mistake.

Thanks to Dominik Schrempf for reporting the bug in issue 177:
<https://github.com/protesilaos/modus-themes/issues/177>.
2025-11-17 12:14:45 +02:00
Protesilaos Stavrou 88fca8fd42
Change how we get the palette for modus-themes-with-colors
This makes it so derivative theme actually get their own colours
instead of those coming from the core theme. Same for user-defined
palette overrides.

Another advantage of this approach is that we keep a separation of
concerns between the different uses we have for the palettes we
retrieve and the structure we want them to have. I prefer this over a
helper function that has to behave according to some optional
parameter.

This is in response to issue 175 by Fritz Gabo, which reports a bug
about derivative themes not getting the right colours when using
modus-themes-with-colors: <https://github.com/protesilaos/modus-themes/issues/175>.

Also thanks to Roshan Shariff for testing my suggested changes (i.e.
this diff) and informing me of getting the expected results out of them.
2025-11-15 13:37:13 +02:00
Protesilaos Stavrou b9eb16d1a1
Make neo-vc-removed-face consistent with vc-removed-state (see commit e08fb8a)
Thanks to Morgan Willcock for discussing with me the use of the
:strike-through style in issue 169: <https://github.com/protesilaos/modus-themes/issues/169>.

The plan is to review all uses of :strike-through to determine which
ones actually benefit from it.
2025-11-14 10:05:00 +02:00
Protesilaos Stavrou e08fb8adcd
Use a wavy underline for vc-removed-state 2025-11-14 10:04:48 +02:00
Protesilaos Stavrou bb548f6564
Use a wavy underline and warning colour for vc-missing-state 2025-11-14 10:04:42 +02:00
Protesilaos Stavrou 3058909617
Use warning instead of err for the vc-dir-status-warning
We use the err colour in other places.
2025-11-14 10:01:13 +02:00
Protesilaos Stavrou ee27621ce8
Use a wavy underline style for Notmuch tag addition and removal
This way the notmuch-tag-deleted is not using a style that is unique
to it. The wavy underline is easy to spot and does not obfuscate the
text of the tag.

Thanks to Morgan Willcock for discussing with me the use of the
:strike-through style in issue 169: <https://github.com/protesilaos/modus-themes/issues/169>.

The plan is to review all uses of :strike-through to determine which
ones actually benefit from it.
2025-11-14 09:42:14 +02:00
Protesilaos Stavrou 0e3b21ef87
Improve the consistency of transient.el unavailable indicators 2025-11-14 07:04:51 +02:00
Protesilaos Stavrou 0cd0b3cc7b
Diversify symbol-overlay faces to all have unique background colours
That was the case before, but I must have changed it by accident when
I was removing most of the :inherit attributes.
2025-11-12 14:29:31 +02:00
Protesilaos Stavrou 3b0850883a
Stop using readable-foreground-color for the org-habit faces
It breaks the themes when they loaded via the early-init.el, as
reported by Gaston Cabotin in issue 174:
<https://github.com/protesilaos/modus-themes/issues/174>.
2025-11-12 08:14:06 +02:00
Protesilaos Stavrou c94938ff79
Greatly expand the manual with complete examples of creating Modus derivatives
This covers the basic and more advanced use cases. It also is for both
private use and making new packages.
2025-11-10 13:02:49 +02:00
Protesilaos Stavrou 4c6a73dc71
Make modus-themes-with-colors use the correct order for palette entries
This affects how the overrides are handled when they mention  a
semantic palette mapping, which itself is a semantic palette mapping.

Thanks to Alexandr Semenov for reporting a relevant bug and testing
this diff in issue 170: <https://github.com/protesilaos/modus-themes/issues/170>.
2025-11-09 11:57:24 +02:00
Protesilaos Stavrou d46e782510
Make gnus-button less intrusive
It is not really a link and it also gets applied to a lot of places
that should not look exactly like links.

Thanks to Morgan Willcock for discussing this with me in issue 140:
<https://github.com/protesilaos/modus-themes/issues/140>.
2025-11-09 11:41:10 +02:00
Protesilaos Stavrou 4fd8cdfc55
Update to modus-themes version 5.1.0 2025-11-07 07:53:36 +02:00
Protesilaos Stavrou bbaa20a45b
Add missing NO-ENABLE to theme check in modus-themes-with-colors-subr
I added that parameter specifically for this case. When I was
committing edd5b66, I thought I had passed it here, but apparently I
did not because that commit also reverted 5777db8...
2025-11-06 10:00:59 +02:00
Protesilaos Stavrou a1149ce5e7
Clarify that a derivative theme has to be in a file among custom-theme-load-path
Thanks to Ashton Wiersdorf for asking for clarification about this in
issue 171: <https://github.com/protesilaos/modus-themes/issues/171>.
2025-11-05 12:55:45 +02:00
Protesilaos Stavrou edd5b66833
Revert 1b66344 and tweak how modus-themes-with-colors binds display spec and 'unspecified'
For some reason the macro was no longer working with commit 1b66344
after I restarted Emacs. Will investigate further. This should
nevertheless be the final commit that fixes all known issues with
modus-themes-with-colors.
2025-11-05 12:39:11 +02:00
Protesilaos Stavrou 5777db8d9b
Fix error with positional argument in latest commit 9c65704 2025-11-05 12:28:41 +02:00
Protesilaos Stavrou 9c65704b61
Avoid recursion in modus-themes-with-colors through enable-theme-functions
The modus-themes-with-colors should either work on an already loaded
theme or do nothing. Otherwise with the enable-theme-functions we end
up with excessive lisp nesting.

Thanks to Alexandr Semenov for reporting the bug in issue 170:
<https://github.com/protesilaos/modus-themes/issues/170>.
2025-11-05 12:21:05 +02:00
Stefan Monnier 1b663444fe
Make modus-themes-with-colors evaluate body as a function
See the discussion on the emacs-devel mailing list:
<https://lists.gnu.org/archive/html/emacs-devel/2025-11/msg00114.html>.
2025-11-05 10:07:49 +02:00
Protesilaos Stavrou 11329d1c49
Make modus-themes--with-colors-resolve-palette-sort easier to read and remove second processing for 'unspecified' 2025-11-04 10:44:24 +02:00
Protesilaos Stavrou 0844ec814a
Remove CRITICAL FIXME comment
I think I have fixed it. Will continue testing throughout the day. If
it works, then I will bump the version number to trigger a GNU ELPA
rebuild. Will also updated emacs.git.
2025-11-04 09:50:09 +02:00
Protesilaos Stavrou 0eae2aa8f5
Make palette sort remove duplicates and limit its use to modus-themes-with-colors
This means that the overrides will be the only ones present instead of
the original values. Also, we do not need this in general but only in
the context of the modus-themes-with-colors.
2025-11-04 08:10:20 +02:00
Protesilaos Stavrou 247f5803bc
Pass missing LEXICAL to 'eval'
This might be what I was missing the whole time. I think the macro is
working now. Will continue testing...
2025-11-04 07:52:31 +02:00
Protesilaos Stavrou 7e06d30099
Make modus-themes-with-colors call a function and update CRITICAL FIXME findings
The updated code of the macro relative to commit 16c2c66 works
correectly at all times ONLY WHEN the function that uses
modus-themes-with-colors is added to the modus-themes-after-load-theme-hook
and thus triggered by modus-themes-load-theme.

The enable-theme-functions and load-theme combination is not working
though and I need to figure out why. It leads to excessive lisp nesting.
2025-11-04 07:00:58 +02:00
Protesilaos Stavrou 0b67bdfb20
Tweak how modus-themes-known-p works with a symbol argument
There is no point in doing seq-every-p with one element...
2025-11-04 06:36:28 +02:00
Protesilaos Stavrou 4fca99d3ac
Document that modus-themes-get-theme-palette may return nil 2025-11-04 06:36:05 +02:00
Protesilaos Stavrou dda6a00e37
Make modus-themes--get-theme-palette-subr return nil instead of an error for unknown THEME 2025-11-04 06:12:25 +02:00
Protesilaos Stavrou 2bc9c72fbd
Make modus-themes-get-theme-palette more efficient
Otherwise modus-themes-get-current-theme calls modus-themes-get-themes
which is also what modus-themes-known-p needs to do.
2025-11-04 06:08:39 +02:00
Protesilaos Stavrou 72ed98f786
Implement modus-themes--get-theme-sort
This makes it easier to place the return value of 'modus-themes-get-theme-palette'
in a 'let*' because something like '(cursor red-warmer)' will come
after '(red-warmer "#ff0000")'.

This might help me sort out the woes with the excessive lisp nesting
of modus-themes-with-colors (see commits 5e77bff and 4514036), but
looks appropriate anyway.
2025-11-04 05:55:31 +02:00
Protesilaos Stavrou 4514036961
Expand the CRITICAL FIXME for modus-themes-with-colors with the failed macro+function test I did
I tried a few variations of that function, but the point is that I
cannot make the macro work inside of a function that is evaluated at
startup in a user's init file. The same function works after I go and
evaluate it manually.

I stumbled across 'define-inline' while looking around in the Emacs
source code, but I am not sure this is what I need... Will need to
test further.
2025-11-04 05:07:39 +02:00
Protesilaos Stavrou 5e77bff62e
Add detailed CRITICAL FIXME comment about modus-themes-with-colors 2025-11-04 03:26:03 +02:00
Protesilaos Stavrou 68de71e7aa
Make modus-themes-with-colors only work when a theme is current
We do not want to break the enable-theme-functions when it is called
with any other non-Modus theme.
2025-11-03 20:15:01 +02:00
Protesilaos Stavrou 0839a6b3cb
Change the logic of modus-themes-get-current-theme
The previous one was faulty because we would get "the first enabled
Modus theme", even if it was not the current one. Whereas I want the
"first enabled only if it is a Modus theme".
2025-11-03 20:15:01 +02:00
Protesilaos Stavrou 70b31306d0
Never throw an error in modus-themes-known-p
Just return nil or the theme. It is the job of other functions to
produce errors.
2025-11-03 20:15:01 +02:00
Protesilaos Stavrou 1d3bdbd2e5
Reinstate what we were doing with load-theme
This undoes what I was trying to do with commits ef3e0e5 (use 'load'
instead of 'load-themes') and 67b6db3 (let bind hooks to nil).

What I did before was wrong. I was thrown off by the fact that
'enable-theme-functions' works with all themes, not just colour
themes. This includes 'user'. In some tests I also got other
configuration themes like 'use-package' or even the ones that come
from my 'fontaine' and 'spacious-padding' packages. But I did not
bother to figure out when those themes would show up. By default,
at least 'user' is passed to the 'enable-theme-functions'.

With 'emacs -Q':

    (defun test (theme)
      (message "Current theme is `%s'" theme))

    (add-hook 'enable-theme-functions #'test)

    (load-theme 'modus-operandi)

    ;; ;; From the *Messages*:
    ;;
    ;; Current theme is ‘user’
    ;; Current theme is ‘modus-operandi’
2025-11-03 20:12:02 +02:00
Protesilaos Stavrou 88d6a8d721
Make markdown-italic-face always italic 2025-11-03 07:07:46 +02:00
Protesilaos Stavrou ef3e0e5d4d
Use 'load' instead of 'load-theme' for the initial theme reification
This looks cleaner and saves us from the trouble of having to deal
with any hooks after load-theme at this early stage. I took the file
binding from the load-theme source.

Fundamentally, I want to have a theme symbol, like 'modus-operandi'
exist with all the relevant 'theme-properties' so that something like
'modus-themes-list-colors' can work with it even before
modus-operandi-theme.el is loaded.
2025-11-02 17:36:14 +02:00
Protesilaos Stavrou 6e1bdce593
Remove strike-through from jabber-roster-user-offline
It does not lead to a nice result. Thanks to Morgan Willcock for
bringing this matter to my attention in issue 169:
<https://github.com/protesilaos/modus-themes/issues/169>.
2025-11-02 14:43:57 +02:00
Protesilaos Stavrou 67b6db32fb
Disable all hooks when activating the themes the first time 2025-11-02 10:06:28 +02:00
Protesilaos Stavrou 16c2c667c4
Update to modus-themes version 5.0.0 2025-11-01 07:12:53 +02:00
Protesilaos Stavrou 26dd0fabb1
Remove an obsolete option from the README.md sample configuration 2025-11-01 07:03:44 +02:00
Protesilaos Stavrou 3f3655451b
Make a small clarification to the Commentary of each file 2025-11-01 07:03:21 +02:00
Protesilaos Stavrou 98c3e0b815
Document the modus-themes-preview-mode and its key bindings 2025-11-01 06:10:50 +02:00
Protesilaos Stavrou d05bd5dde5
Extend modus-themes-preview-mode with commands to copy colors or palette entries 2025-11-01 06:10:50 +02:00
Protesilaos Stavrou 83c34e9726
Make the elisp-feature face use the constant mapping
Normally features get the font-lock-constant-face, but there may be
scenaria where the generic font-lock is not doing the right thing,
whereas the semantic highlighting will. So having this face takes care
of the latter.

Thanks to Eshel Yaron for explaining this to me in the discussion
around Emacs bug 79677: <https://lists.gnu.org/archive/html/bug-gnu-emacs/2025-10/msg01156.html>.
2025-10-31 17:29:38 +02:00
Protesilaos Stavrou c2acde4a47
Merge pull request #168 from wyuenho/patch-1
Fix powerline theme definitions for inactive states
2025-10-31 10:14:23 +02:00
Jimmy Yuen Ho Wong e52f388522
Fix powerline theme definitions for inactive states 2025-10-30 22:47:47 +00:00
Protesilaos Stavrou 223e813805
Swap the style of elisp-shadowed-variable and elisp-shadowing-variable
This is in response to further feedback from Eshel Yaron in Emacs bug
79677: <https://lists.gnu.org/archive/html/bug-gnu-emacs/2025-10/msg01156.html>.
2025-10-30 12:27:17 +02:00
Protesilaos Stavrou acc01872a3
Make the org-list-dt foreground slightly different than the main one 2025-10-30 11:30:21 +02:00
Protesilaos Stavrou 920f7ae8b2
Tweak the org-dispatcher-highlight 2025-10-30 11:29:02 +02:00
Protesilaos Stavrou 0648a01dee
Simplify the minibuffer-depth-indicator 2025-10-30 11:19:27 +02:00
Protesilaos Stavrou 51e067c9df
Change the modus-vivendi-tinted mapping for variable-use 2025-10-30 07:29:15 +02:00
Protesilaos Stavrou 39e2c01cc0
Tweak modus-operandi-tritanopia slate value 2025-10-30 07:28:20 +02:00
Protesilaos Stavrou 19b21a3876
Add support for Emacs Lisp semantic highlighting (Emacs 31)
Thanks to Eshel Yaron, the author of this feature, for (i) asking me
to add theme support and (ii) helping me understand the intended use
of semantic highlighting.

This was done in Emacs bug 79677 and on the emacs-devel mailing list:

- <https://lists.gnu.org/archive/html/bug-gnu-emacs/2025-10/msg01156.html>.
- <https://lists.gnu.org/archive/html/emacs-devel/2025-10/msg00728.html>.
2025-10-30 06:50:24 +02:00
Protesilaos Stavrou 1eb95eac3c
Tweak the modus-vivendi-tinted variable use mapping 2025-10-30 06:37:35 +02:00
Protesilaos Stavrou 71ba12c4d7
Tweak the modus-operandi-tritanopia variable use mapping 2025-10-30 06:37:21 +02:00
Protesilaos Stavrou db6c6b5e97
Tweak the modus-operandi-tritanopia function call mapping 2025-10-30 06:37:06 +02:00
Protesilaos Stavrou f4ada31861
Tweak the modus-operandi-deuteranopia function call mapping 2025-10-30 06:36:41 +02:00
Protesilaos Stavrou 60b99c1a7c
Make eglot-highlight-symbol-face more subtle 2025-10-30 06:35:57 +02:00
Protesilaos Stavrou 388f92e2d7
Make modus-vivendi-tinted rust a bit more orange 2025-10-30 05:41:25 +02:00
Protesilaos Stavrou e5f23ca184
Make all light variants of gold and olive a bit more dark 2025-10-30 05:41:20 +02:00
Protesilaos Stavrou effaf91b9c
Tweak modus-vivendi-tinted fg-sage value 2025-10-29 21:20:22 +02:00
Protesilaos Stavrou b15e40987f
Tweak modus-vivendi fg-ochre value 2025-10-29 21:19:58 +02:00
Protesilaos Stavrou 2dbcc8f903
Support font-lock-function-call-face and font-lock-variable-use-face with bespoke mappings 2025-10-29 21:19:02 +02:00
Protesilaos Stavrou 8b4e9d9ccd
Make forge-topic-unread and gnus-summary-high-read unconditionally bold
This is the intended style. I made a mistake to use modus-themes-bold.
2025-10-29 09:20:01 +02:00
Protesilaos Stavrou 33a8ca40b5
Make elfeed-search-unread-title-face always be bold
It needs it. More generally, we have this style for "unread" items in
mu4e and notmuch.
2025-10-29 09:17:07 +02:00
Protesilaos Stavrou c4b5b27ad1
Remove an old make-obsolete-variable 2025-10-29 06:44:30 +02:00
Protesilaos Stavrou 9fc269c0a6
Sort all the define-obsolete-face-alias we have for the new version 2025-10-29 06:43:09 +02:00
Protesilaos Stavrou 94878dbd9c
Move modus-themes-completion-selected closer to its related faces 2025-10-29 06:42:29 +02:00
Protesilaos Stavrou 4f707d9a53
Deprecate "key binding" face we define
This was the old way of doing things before we had the semantic
palette overrides. Back then it made sense to have a face and then
inherit it, otherwise it was impossible to track was "means" what.
2025-10-29 06:40:12 +02:00
Protesilaos Stavrou 85101fb4ab
Deprecate all the "prominent error" faces we define
This was the old way of doing things before we had the semantic
palette overrides. Back then it made sense to have a face and then
inherit it, otherwise it was impossible to track was "means" what.
2025-10-29 06:40:12 +02:00
Protesilaos Stavrou 8f39cafdda fixup! Deprecate all the "mark" faces we define 2025-10-29 06:30:00 +02:00
Protesilaos Stavrou fce1a5e835
Remove the declaration of faces that are already obsolete 2025-10-29 06:29:25 +02:00
Protesilaos Stavrou d90dffe3cf
Deprecate all the "prose markup" faces we define
This was the old way of doing things before we had the semantic
palette overrides. Back then it made sense to have a face and then
inherit it, otherwise it was impossible to track was "means" what.
2025-10-29 06:18:26 +02:00
Protesilaos Stavrou d25d0318ad
Deprecate all the "mark" faces we define
This was the old way of doing things before we had the semantic
palette overrides. Back then it made sense to have a face and then
inherit it, otherwise it was impossible to track was "means" what.
2025-10-29 06:14:40 +02:00
Protesilaos Stavrou 589b49cea0
Deprecate all the "lang error" faces we define
This was the old way of doing things before we had the semantic
palette overrides. Back then it made sense to have a face and then
inherit it, otherwise it was impossible to track was "means" what.
2025-10-29 05:57:25 +02:00
Protesilaos Stavrou 7183244783
Deprecate all the "search rx" faces we define
This was the old way of doing things before we had the semantic
palette overrides. Back then it made sense to have a face and then
inherit it, otherwise it was impossible to track was "means" what.
2025-10-29 05:54:40 +02:00
Protesilaos Stavrou f8514d5e15
Deprecate all the "search" faces we define
This was the old way of doing things before we had the semantic
palette overrides. Back then it made sense to have a face and then
inherit it, otherwise it was impossible to track was "means" what.
2025-10-29 05:51:34 +02:00
Protesilaos Stavrou 8803f696cd
Update the Commentary of all the files 2025-10-29 05:43:01 +02:00
Protesilaos Stavrou 647f117506
Add FIXME to autoload the theme palettes
There has to be a way. I feel I am missing some detail.
2025-10-29 05:38:19 +02:00
Protesilaos Stavrou f7ac5a6aa0
Tweak the fg-alt value of modus-themes-operandi-tritanopia-palette 2025-10-27 07:28:09 +02:00
Protesilaos Stavrou ae80e32ea7
Deprecate all remaining colour-specific faces that we define
These should be replaced with semantic palette mappings. But I can do
that for version 5.1.0. Right now, I am interested in the groundwork.
2025-10-26 10:10:17 +02:00
Protesilaos Stavrou ea426e5c90
Acknowledge Kevin Fleming for commit c681422
The change is small, meaning that Kevin does not need to assign
copyright to the Free Software Foundation.

This was done in pull request 166, fixing a regression that I
introduced in commit 08820b2: <https://github.com/protesilaos/modus-themes/pull/166>.
2025-10-26 07:15:51 +02:00
Protesilaos Stavrou e6463c0e21
Reinstate the generic typography faces
This is to ensure that we do not get unwanted styles in some cases, as
reported by chainedghost in issue 167:
<https://github.com/protesilaos/modus-themes/issues/167>.
2025-10-26 07:14:10 +02:00
Protesilaos Stavrou f6d56513dd
Merge pull request #166 from ktfleming/main
Add missing parentheses on proced faces
2025-10-26 07:12:01 +02:00
Kevin Fleming c681422305
Add missing parentheses on proced faces 2025-10-25 18:44:58 +01:00
Protesilaos Stavrou f6fe42f046
Use the 'comment' mapping instead of 'fg-dim' for three more comment-related faces 2025-10-25 16:32:38 +03:00
Protesilaos Stavrou a8d8332398
Set the missing foreground for the Git commit/rebase comment headers
This fixes a regression that was introduced by commit 08820b2.
2025-10-25 16:30:10 +03:00
Protesilaos Stavrou 493bd7a243
Fix broken parentheses 2025-10-25 10:56:12 +03:00
Protesilaos Stavrou 08820b2599
BREAKING Be much more conservative with :inherit
This is related to Emacs bug#79672: <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=79672>.

What I did was to review ALL the uses of :inherit and try to do the
following:

- Limit recursive inheritence.
- Inherit from Modus faces.
- Do not inherit when semantic palette mappings can be used directly.

There are some exceptions, but the idea is to rely less on :inherit
and more on the palette entries we provide. This is anyway good for
us: I needed to make this change since I introduce the semantic
palette mappings.

In the process of doing this I also reviewed lots of faces. I might
have made some mistakes, but things are looking good overall.
2025-10-25 08:30:08 +03:00
Protesilaos Stavrou 0a2c7b84b1
Make the escape-glyph use a more appropriate semantic colour mapping
Also make it bold if modus-themes-bold-constructs is non-nil.
2025-10-25 06:48:47 +03:00
Protesilaos Stavrou 6eac188782
Stop configuring default typography faces
Their original values are fine and we may run into unexpected problems
by limiting them to a subset of supported display specifications (via
the ,c we have there).
2025-10-25 06:46:14 +03:00
Protesilaos Stavrou 574587f56b
Stop configuring rcirc-color and make obsolete the relevant faces
We defined the faces just for this case. I think the package should
accept a vector with colour values, like regular rcirc does with the
'rcirc-color-codes'. Then we can check back again.
2025-10-25 05:30:22 +03:00
Protesilaos Stavrou 21327092f0
Update the manual to reflect the latest state of support packages 2025-10-24 08:25:35 +03:00
Protesilaos Stavrou 233571e577
Improve the obsolesence warning for 'modus-themes-custom-auto-reload'
Thanks to Stefan Monnier for suggesting this format on the emacs-devel
mailing list: <https://lists.gnu.org/archive/html/emacs-devel/2025-10/msg00603.html>.
2025-10-24 08:23:18 +03:00
Protesilaos Stavrou a1ad1e5ef7
Remove support for the external tree-sitter package
We have the functionality built into Emacs now. Those who care enough
about this technology are probably using a version of Emacs that
supports it.
2025-10-24 07:02:23 +03:00
Protesilaos Stavrou 0482eab0f4
Use more generic colours for debbugs faces to work with all our themes
Otherwise the deuteranopia and tritanopia themes are not doing the
right thing.
2025-10-24 06:49:09 +03:00
Protesilaos Stavrou 6b2053b4ae
Remove support for indium package
From what I can tell, it is basically irrelevant for modern JS developers.
2025-10-24 06:43:38 +03:00
Protesilaos Stavrou 3ac449fb45
Remove dirty hack with the highlight-regexp faces
Yes, the :inverse-video preserves the background but it can make the
foreground unreadable. I think it is better to let hl-line-mode take
priority in this case. Maybe the alternative is to modify the overlay
'priority' property of those highlights, but this is not the theme's
prerogative.
2025-10-24 06:33:58 +03:00
Protesilaos Stavrou 407bf5e510
Make sure the org-habit faces always use a readable foreground
These faces are problematic because their colour coded background is
their essential quality. Having "readable" text here may be well below
the 7:1 contrast target. We have to do this otherwise we will need to
compromise on the background values, which makes them harder to tell
apart and thus less useful for what they are meant to do.
2025-10-24 06:13:06 +03:00
Protesilaos Stavrou b2e6d78d5f
Remove support for enh-ruby-mode (enhanced-ruby-mode)
I expect everyone to be using LSP by now.
2025-10-24 06:03:13 +03:00
Protesilaos Stavrou 902a601c08
Stop supporting agda2-mode
We are trying to fix something that should be handled directly in that
package, namely, for it to just inherit from font-lock instead of
trying to do its own thing.
2025-10-24 05:58:41 +03:00
Protesilaos Stavrou 74767ad3f8
Acknowledge shimeike for commit b741887
This is about issue 163, where I forgot to include this change in the
original commit: <https://github.com/protesilaos/modus-themes/issues/163>.
2025-10-23 11:55:01 +03:00
Protesilaos Stavrou b741887a87
Make sure palette preview shows the mapping's value
Thanks to shimeike for reporting the problem in issue 163:
<https://github.com/protesilaos/modus-themes/issues/163>.
2025-10-23 11:53:41 +03:00
Protesilaos Stavrou a8325500bc
Add commands to mark, unmark, and copy entries in modus-themes-list-colors buffer 2025-10-23 07:30:42 +03:00
Protesilaos Stavrou 0ef42d8a92
Make stylistic changes to modus-themes--list-colors-tabulated 2025-10-23 06:44:33 +03:00
Protesilaos Stavrou 3b47b64a38
Reword the obsolescence warning about modus-themes-custom-auto-reload 2025-10-23 06:33:17 +03:00
Protesilaos Stavrou 41074f39a2
Make sure we activate themes only once 2025-10-23 06:22:27 +03:00
Protesilaos Stavrou f71a62c50f
Update the documentation about building on top of the Modus themes 2025-10-22 08:34:55 +03:00
Protesilaos Stavrou a6db89ac18
Make sure the 'modus-themes-theme' reads the updated palette value
Otherwise palette overrides do not work intended. This was a
regression caused by commit 085ee06.

Thanks to chainedghost for reporting the bug in issue 161:
<https://github.com/protesilaos/modus-themes/issues/161>.
2025-10-21 08:25:16 +03:00
Protesilaos Stavrou f55db96b09
Make the modus-themes-common-palette-overrides apply also to derivative themes 2025-10-20 16:15:32 +03:00
Protesilaos Stavrou 149da8e473
Reindent the theme files after commit 085ee06
That commit removed the 'eval-and-compile' they were wrapped in, but I
did not want to also introduce spacing changes there.
2025-10-20 07:28:05 +03:00
Protesilaos Stavrou 085ee06c57
Make the modus-themes-theme a defun instead of a defmacro
I have been facing issues with the macro where certain palette entries
are not known at compile time. I want to experiment with the defun, as
it is always going to be called at runtime.
2025-10-20 07:26:37 +03:00
Protesilaos Stavrou c2aa51f495
Acknowledge Frédéric Giquel for commit 1099f8a
This was done in pull request 160: <https://github.com/protesilaos/modus-themes/pull/160>.

The change is small, meaning that Frédéric does not need to assign
copyright to the Free Software Foundation.
2025-10-19 11:02:57 +03:00
Protesilaos Stavrou 36ac9e5861
Merge pull request #160 from fredericgiquel/fix-markdown-code-face
Make markdown-code-face consistent with org-block
2025-10-19 11:01:45 +03:00
Frédéric Giquel 1099f8a20d Make markdown-code-face consistent with org-block 2025-10-19 09:26:22 +02:00
Protesilaos Stavrou d8a80e52d1
Revert "Make the modus-themes-common-palette-mappings a defvar instead of defconst"
This reverts commit 02b4027555.

It turns out that this does not fix the problem. If so, I prefer to
declare this as a 'defconst'.
2025-10-13 08:12:46 +03:00
Protesilaos Stavrou 02b4027555
Make the modus-themes-common-palette-mappings a defvar instead of defconst
I have had this issue for a while where loading the .elc version of
the themes would result in nil values for the mappings defined in the
modus-themes-common-palette-mappings. I tried a few things and it
seems that this is enough to make things work as expect, i.e. to have
the list reified at compile time so that the individual theme palettes
get all the mappings correctly.
2025-10-12 08:32:00 +03:00
Protesilaos Stavrou 8582e487a4
Remove two duplicate mappings 2025-10-12 07:51:18 +03:00
Protesilaos Stavrou 9ef5731b5b
Remove duplicate entries of palette mappings for buttons 2025-10-12 07:44:41 +03:00
Protesilaos Stavrou f186a4e0af
Make header-line-inactive inherit header-line 2025-10-12 07:21:06 +03:00
Protesilaos Stavrou 4798477791
Expand the manual to mention modus-themes-define-derivative-command 2025-10-11 20:36:39 +03:00
Protesilaos Stavrou cae9e08865
Include a doc string in the output of modus-themes-define-derivative-command 2025-10-11 20:36:06 +03:00
Protesilaos Stavrou a391efc0f8
Remove hardcoded colour values from some Magit faces 2025-10-10 07:47:06 +03:00
Protesilaos Stavrou 99eb9d4c9a
Make widget-field use appropriate colour mappings and have an underline 2025-10-10 07:08:46 +03:00
Protesilaos Stavrou cfa3545171
Make modus-themes-custom-auto-reload obsolete 2025-10-07 07:15:06 +03:00
Protesilaos Stavrou 933a926247
Provide the macro modus-themes-define-derivative-command for derivative themes 2025-10-06 07:29:35 +03:00
Protesilaos Stavrou 563316fa89
Acknowledge Suleyman Boyar for commit 8c46843
The change is small, meaning that Suleyman does not need to assign
copyright to the Free Software Foundation.

This was done in pull request 156:
<https://github.com/protesilaos/modus-themes/pull/156>.
2025-10-05 17:55:28 +03:00
Protesilaos Stavrou e411452012
Merge pull request #156 from suboyar/main
Remove redundant theme name argument from modus-themes-declare call
2025-10-05 17:53:12 +03:00
suboyar 8c4684325e Remove redundant theme name argument from modus-themes-declare call
The function doesn't accept this parameter and constructs it internally.
2025-10-05 16:04:43 +02:00
Protesilaos Stavrou 91cd9dfed3
Make the match face use its own mapping 2025-10-04 07:59:17 +03:00
Protesilaos Stavrou 0648760267
Revert "Add an 'eval-and-compile' around all palette variables"
This reverts commit 7111708f15.

I thought this was needed to fix a warning I get about 'nil'
foreground value for a couple of faces. It seems that the mappings in
'modus-themes-common-palette-mappings' are not read and so I suspected
this was because of them not being known at compile time. Apparently,
this does not fix the problem, so I must check elsewhere...
2025-10-03 10:49:41 +03:00
Protesilaos Stavrou e942399a16
Add docstring for the method modus-themes-get-themes 2025-10-03 10:42:31 +03:00
Protesilaos Stavrou 7111708f15
Add an 'eval-and-compile' around all palette variables
I believe we need this because the individual theme files have the same.
2025-10-03 10:37:45 +03:00
Protesilaos Stavrou efbedafcbb
Remove the duplicate mappings for date-now 2025-10-03 10:36:42 +03:00
Protesilaos Stavrou 1f42a8165d
Expand the README.md with sample config and note about Modus as a platform 2025-10-03 09:36:49 +03:00
Protesilaos Stavrou b104e2b9f4
Update the documentation about building on top of the Modus themes 2025-10-03 07:37:07 +03:00
Protesilaos Stavrou c05e5a0433
Expand the modus-themes-theme macro to accept optional faces and custom variables 2025-10-03 07:36:45 +03:00
Protesilaos Stavrou 3e091098f0
Add back the missing annotation function
I must have deleted it as part of that botched rebase I did. Anyway,
this sort of thing will not even be visible to users of the marginalia
package, but is still good to have.
2025-10-02 19:57:40 +03:00
Protesilaos Stavrou 6326130654
Make minor tweaks to the sample configurations 2025-10-01 18:44:30 +03:00
Protesilaos Stavrou 14b7dd39a2
Document the other commands that load a theme 2025-10-01 18:32:05 +03:00
Protesilaos Stavrou 64681aadf5
Make 5.0.0 our current development target 2025-10-01 18:29:09 +03:00
Protesilaos Stavrou 247a9f7291
Document how to build on top of the modus-themes 2025-10-01 07:52:33 +03:00
Protesilaos Stavrou f86f23362f
Update the Info version of the manual 2025-10-01 07:52:33 +03:00
Protesilaos Stavrou 5cdb8cc81d
Document the new behaviour of modus-themes-rotate 2025-10-01 07:52:33 +03:00
Protesilaos Stavrou c100ec6844
Make small change to the manual to affect the Info output's render of a kbd 2025-10-01 07:52:33 +03:00
Protesilaos Stavrou eac296eb1d
Use modus-themes-sort in the method of modus-themes-include-derivatives-mode 2025-10-01 07:52:33 +03:00
Protesilaos Stavrou e8f99ba7d7
Mention modus-themes-sort in modus-themes-get-all-known-themes 2025-10-01 07:52:32 +03:00
Protesilaos Stavrou 1d71c7d942
Use modus-themes-sort in the generic modus-themes-get-themes 2025-10-01 07:52:32 +03:00
Protesilaos Stavrou 49d435ee79
Implement a modus-themes-sort function 2025-10-01 07:52:32 +03:00
Protesilaos Stavrou 154f876545
Redo the helper to check for background and adapt modus-themes-filter-by-background-mode 2025-10-01 07:52:32 +03:00
Protesilaos Stavrou 36decff7c2
Se the modus-themes-to-rotate nil and allow default rotation through modus-themes-get-themes 2025-10-01 07:52:32 +03:00
Protesilaos Stavrou 52f8e110bb
Make small stylistic refinements 2025-10-01 07:52:32 +03:00
Protesilaos Stavrou 97966a3502
Include the frame-background-mode in the theme macro 2025-10-01 07:52:32 +03:00
Protesilaos Stavrou 5f6ac4b130
Make the git-commit branches less intense
They do not need to stand out as much.
2025-09-30 12:21:48 +03:00
Protesilaos Stavrou 01f683346f
Make modus-themes-rotate prompt for a theme if it cannot rotate there
This is better for us because then we do not need to have derivative
theme packages necessarily implement their own version of
'modus-themes-to-rotate'. Plus, the user may have forgotten to update
that user option.
2025-09-30 12:14:33 +03:00
Protesilaos Stavrou 86112e457a
Use the correct value for our modus-themes-get-themes method 2025-09-30 07:38:52 +03:00
Protesilaos Stavrou 63ba534f1a
Reword the documentation string of modus-themes-get-themes 2025-09-30 07:05:24 +03:00
Protesilaos Stavrou b20d38115b
Reformat the palette variables and introduce some shared mappings 2025-09-29 23:27:26 +03:00
Protesilaos Stavrou b73415fda1
Use generic comments for inside the palettes 2025-09-29 22:56:06 +03:00
Protesilaos Stavrou d6b387f6ad
Make stylistic change to the theme obsolete aliases 2025-09-29 22:35:43 +03:00
Protesilaos Stavrou bea8a0436e
Tweak the modus-themes--activate 2025-09-29 22:32:03 +03:00
Protesilaos Stavrou 4c01c5e479
Again, fix things from the clumsy rebase... 2025-09-29 22:23:40 +03:00
Protesilaos Stavrou 27558488ef
Change how themes are activated and fix known issues with modus-themes-get-theme-palette 2025-09-29 22:10:53 +03:00
Protesilaos Stavrou c2016385f9
Reinstate a change that I messed up with the botched rebase 2025-09-29 21:34:54 +03:00
Protesilaos Stavrou 566c1ba4ca
Add missing change from 8557c39 2025-09-29 20:26:20 +03:00
Protesilaos Stavrou 8557c39298
Add FIXME for modus-themes-get-theme-palette overrides 2025-09-29 20:24:51 +03:00
Protesilaos Stavrou 0739ea4406
I messed up the rebase and had to redo things...
Hopefully I did not miss something and broke stuff.
2025-09-29 20:19:51 +03:00
Protesilaos Stavrou ecf3698412
Tweak how 'unspecified looks in the modus-themes-list-colors 2025-09-29 20:02:11 +03:00
Protesilaos Stavrou 711b9c1454
Make sure modus-themes-list-colors loads its theme to avoid errors 2025-09-29 20:02:11 +03:00
Protesilaos Stavrou 5b7cd71019
Name the modus-themes-get-theme-palette overrides parameter correctly
I got it wrong the first time.
2025-09-29 20:02:07 +03:00
Protesilaos Stavrou f8881652d3
Fix the feature of custom-declare-theme that we pass 2025-09-29 20:01:56 +03:00
Protesilaos Stavrou 0bd89da8ae
Keep modus-themes-include-derivatives-mode disabled by default 2025-09-29 20:01:56 +03:00
Protesilaos Stavrou d9adb13ebc
Make sure a theme is registered only if it is not a Modus theme 2025-09-29 20:01:56 +03:00
Protesilaos Stavrou 5a335389b1
Declare all the Modus themes at the outset to speed things up 2025-09-29 20:01:56 +03:00
Protesilaos Stavrou 636a19a28b
Rename the minor mode to modus-themes-include-derivatives-mode
This is more self-evident.
2025-09-29 20:01:56 +03:00
Protesilaos Stavrou e5f0a31f92
Fall back to -1 instead of 0 in modus-themes-rotate-subr
Thanks to Grant Rosson for pointing this out in issue 60 on the
ef-themes repository: <https://github.com/protesilaos/ef-themes/issues/60#issuecomment-3346124052>.
2025-09-29 20:01:56 +03:00
Protesilaos Stavrou ee104f0f16
Make the theme declaration and registration their own functions 2025-09-29 20:01:56 +03:00
Protesilaos Stavrou 97c23e87d8
Require cl-lib at compile time for cl-defgeneric and cl-defmethod
I think we do not need this for newer versions of Emacs, but it does
no harm, anyway.
2025-09-29 20:01:56 +03:00
Protesilaos Stavrou 4c245ba030
Remove the :before from the defmethod because it is not right
I had it for the Modus equivalent as well...
2025-09-29 20:01:56 +03:00
Protesilaos Stavrou 4a7ff08327
Remove superfluous colon symbol from modus-themes-list-colors 2025-09-29 20:01:56 +03:00
Protesilaos Stavrou d945f1c1aa
Make modus-themes-rotate-subr more robust 2025-09-29 20:01:55 +03:00
Protesilaos Stavrou 8317ad8d50
Instead of reinventing THEMES filters, use defmethods instead 2025-09-29 20:01:54 +03:00
Protesilaos Stavrou bb5a91f9c1
Make the modus-themes-rotate-subr start from 0 if no other position is available
We still want to perform a rotation when the current theme is not on
the modus-themes-to-rotate. This is done in response to issue 60 on
the ef-themes repository (but applies to use here too, more so since I
am redesigning the ef-themes to be derived from the modus-themes):
<https://github.com/protesilaos/ef-themes/issues/60>.
2025-09-29 20:01:10 +03:00
Protesilaos Stavrou f3ca643038
Make small rewording in a doc string 2025-09-29 20:01:10 +03:00
Protesilaos Stavrou 741486b03c
Rewrite modus-themes-get-all-known-themes to not assume nil family as Modus
It is easier to give it a family when we need to, else to accept all
the themes.
2025-09-29 20:01:10 +03:00
Protesilaos Stavrou 102650a412
Rename the helper for modus-themes-rotate for consistency with the load random approach 2025-09-29 20:01:08 +03:00
Protesilaos Stavrou bdd3470622
Make modus-themes-load-theme accept an optional hook argument 2025-09-29 20:00:50 +03:00
Protesilaos Stavrou a91870a447
Make the load theme helpers easier to work with 2025-09-29 20:00:50 +03:00
Protesilaos Stavrou 076709b769
Define a subroutine for modus-themes-load-random
This makes it easier to reuse the code while building on top of the modus-themes.
2025-09-29 20:00:49 +03:00
Protesilaos Stavrou 08ed0d631c
Make modus-themes-get-all-known-themes filter by theme family
This is more flexible than having a no derivatives toggle.
2025-09-29 20:00:49 +03:00
Protesilaos Stavrou 91b9b3f9ae
Move the theme palettes out of their respective files into modus-themes.el
This way any other package can build on top of Modus without having to
load any of those themes.
2025-09-29 20:00:44 +03:00
Protesilaos Stavrou f52e2f16b0
Define commands to load a random theme, plus necessary helper functions 2025-09-29 19:58:43 +03:00
Protesilaos Stavrou 7a76dca731
Use seq-union in modus-themes-get-all-known-themes
Looks nicer than (delete-dups (append ...)) plus it sound more right.
2025-09-29 19:58:43 +03:00
Protesilaos Stavrou 76fe11a79c
Define helper function to activate a theme and simplify modus-themes-get-all-known-themes 2025-09-29 19:58:43 +03:00
Protesilaos Stavrou e84e1a7b0b
Make sure the common overrides are accounted for in the theme's scope 2025-09-29 19:58:43 +03:00
Protesilaos Stavrou 95dde90c84
Reorder the forms in the macro to put the let closer to where it is needed 2025-09-29 19:58:39 +03:00
Protesilaos Stavrou 161391ba67
Rebase theme redesign on top of main 2025-09-29 19:57:32 +03:00
Protesilaos Stavrou 6f0e64daaa
Revert "Make modus-themes--current-theme only return an active theme (Emacs bug#79504)"
This reverts commit 76ea634816.
2025-09-28 20:16:35 +03:00
Protesilaos Stavrou 6d590469e5
Revert "Make the modus-themes-select-prompt public and extend it to be used by others"
This reverts commit 6cc997945f.
2025-09-28 20:16:34 +03:00
Protesilaos Stavrou e6df63dacd
Revert "Deprecate modus-themes-custom-auto-reload"
This reverts commit e32af5e54d.
2025-09-28 20:16:33 +03:00
Protesilaos Stavrou c56c1a3cf0
Revert "Remove outdated comment from one user option"
This reverts commit d13e9a8bd9.
2025-09-28 20:16:32 +03:00
Protesilaos Stavrou d0a4d673ee
Revert "Redefine how themes are registered (the macro) and retrieved"
This reverts commit 6be21f1119.
2025-09-28 20:16:31 +03:00
Protesilaos Stavrou 53df07e5e8
Revert "Remove the Custom :set function from all theme files (continue from e32af5e)"
This reverts commit da5d701f6c.
2025-09-28 20:16:31 +03:00
Protesilaos Stavrou cf88cc5b13
Revert "Tweak how the modus-themes-toggle is done"
This reverts commit c9fa2b8d83.
2025-09-28 20:16:30 +03:00
Protesilaos Stavrou 69d949fb27
Revert "Tweak how the modus-themes-rotate is done"
This reverts commit abb41f9836.
2025-09-28 20:16:29 +03:00
Protesilaos Stavrou 87c7fa3e4b
Revert "Make sure palette 'append' happens in the correct order"
This reverts commit e33c037359.
2025-09-28 20:16:28 +03:00
Protesilaos Stavrou 4a7f7b18b3
Revert "Make modus-themes-get-theme-palette append symbol values and accept overrides only"
This reverts commit 264814f51e.
2025-09-28 20:16:26 +03:00
Protesilaos Stavrou 7b7cc02f1c
Revert "Make tweaks based on new modus-themes-get-theme-palette (per commit 264814f)"
This reverts commit 753cdab306.
2025-09-28 20:16:21 +03:00
Protesilaos Stavrou 753cdab306
Make tweaks based on new modus-themes-get-theme-palette (per commit 264814f) 2025-09-28 15:52:59 +03:00
Protesilaos Stavrou 264814f51e
Make modus-themes-get-theme-palette append symbol values and accept overrides only 2025-09-28 15:51:41 +03:00
Protesilaos Stavrou e33c037359
Make sure palette 'append' happens in the correct order
Otherwise, the overrides never work.
2025-09-28 11:32:44 +03:00
Protesilaos Stavrou abb41f9836
Tweak how the modus-themes-rotate is done 2025-09-28 10:48:18 +03:00
Protesilaos Stavrou c9fa2b8d83
Tweak how the modus-themes-toggle is done 2025-09-28 10:46:24 +03:00
Protesilaos Stavrou da5d701f6c
Remove the Custom :set function from all theme files (continue from e32af5e) 2025-09-28 10:46:00 +03:00
Protesilaos Stavrou 6be21f1119
Redefine how themes are registered (the macro) and retrieved 2025-09-28 10:43:02 +03:00
Protesilaos Stavrou d13e9a8bd9
Remove outdated comment from one user option 2025-09-28 08:36:27 +03:00
Protesilaos Stavrou e32af5e54d
Deprecate modus-themes-custom-auto-reload
It complicates things for us and also has the disadvantage of running
as many times as the setopt variables being set. Users should just
learn to reload their theme and/or Emacs should have some built-in
mechanism. This is not our problem to fix.
2025-09-28 08:34:05 +03:00
Protesilaos Stavrou 6cc997945f
Make the modus-themes-select-prompt public and extend it to be used by others
The plan is to empower other themes to use this with whatever little
glue code they need.
2025-09-27 11:23:48 +03:00
Protesilaos Stavrou 76ea634816
Make modus-themes--current-theme only return an active theme (Emacs bug#79504)
Otherwise we end up loading the first among the "known themes" even
when the user had no such intention.

Thanks to Zhengyi Fu for reporting the bug on the Emacs tracker.
2025-09-27 11:22:01 +03:00
Protesilaos Stavrou 2c4e1dc7ce
Add support for minibuffer-nonselected
I tried many styles, but because the minibuffer colours are
customisable we cannot know if, say, "red background" is going to look
different than what the user has set. The colour inversion is not the
prettiest in this case, but works well.
2025-09-23 12:42:43 +03:00
Protesilaos Stavrou 7c5eed1cda
Refine the Custom buttons (also see commit 58d1b88) 2025-09-20 14:02:37 +03:00
Protesilaos Stavrou 58d1b88c1d
Refine the modus-themes-button style 2025-09-20 14:00:31 +03:00
Protesilaos Stavrou 161792b1b0
Make org-date-selected inherit calendar-today 2025-09-09 09:55:33 +03:00
Protesilaos Stavrou 92109f871b
Make calendar-today easier to spot 2025-09-09 09:55:14 +03:00
Protesilaos Stavrou 5d474cd524
Make the mode line faces use an underline if :box is not supported 2025-09-03 07:52:36 +03:00
Protesilaos Stavrou e9c612c6c0
Make the notmuch-message-summary-face use an overline if possible 2025-09-03 07:47:57 +03:00
Protesilaos Stavrou c40225e6d9
Add support for the magit-section-secondary-heading
It uses ':weight bold' whereas we want ':inherit bold'. The latter
gives users the option to modify the font family of the 'bold' face,
such as to make it extrabold.
2025-09-03 07:44:52 +03:00
Protesilaos Stavrou f4e67c80c9
Update the manual's acknowledgements to rename a person mentioned there 2025-07-18 07:10:26 +03:00
Protesilaos Stavrou b55d84a5cb
Explicitly cover the tab-bar-tab-highlight face
This is because its style was changed in Emacs 31 and now we do not
get what we used to have.
2025-07-12 07:43:49 +03:00
14 changed files with 11207 additions and 8443 deletions

File diff suppressed because it is too large Load diff

106
README.md
View file

@ -20,6 +20,12 @@ Such major versions are not backward-compatible due to the limited
resources at my disposal to support multiple versions of Emacs and of
the themes across the years.
Starting with version `5.0.0` of the `modus-themes`, other packages
can be built on top to provide their own "Modus" derivative themes.
The manual has a section about building on top of Modus. My
`ef-themes` and `standard-themes` are done in this way (versions
`2.0.0` and `3.0.0`, respectively).
+ Package name (GNU ELPA): `modus-themes`
+ Official manual: <https://protesilaos.com/emacs/modus-themes>
+ Change log: <https://protesilaos.com/emacs/modus-themes-changelog>
@ -29,3 +35,103 @@ the themes across the years.
+ GitHub: <https://github.com/protesilaos/modus-themes>
+ GitLab: <https://gitlab.com/protesilaos/modus-themes>
+ Backronym: My Old Display Unexpectedly Sharpened ... themes.
```elisp
(use-package modus-themes
:ensure t
:demand t
:init
;; Starting with version 5.0.0 of the `modus-themes', other packages
;; can be built on top to provide their own "Modus" derivatives.
;; For example, this is what I do with my `ef-themes' and
;; `standard-themes' (starting with versions 2.0.0 and 3.0.0,
;; respectively).
;;
;; The `modus-themes-include-derivatives-mode' makes all Modus
;; commands that act on a theme consider all such derivatives, if
;; their respective packages are available and have been loaded.
;;
;; Note that those packages can even completely take over from the
;; Modus themes such that, for example, `modus-themes-rotate' only
;; goes through the Ef themes (to this end, the Ef themes provide
;; the `ef-themes-take-over-modus-themes-mode' and the Standard
;; themes have the `standard-themes-take-over-modus-themes-mode'
;; equivalent).
;;
;; If you only care about the Modus themes, then (i) you do not need
;; to enable the `modus-themes-include-derivatives-mode' and (ii) do
;; not install and activate those other theme packages.
(modus-themes-include-derivatives-mode 1)
:bind
(("<f5>" . modus-themes-rotate)
("C-<f5>" . modus-themes-select)
("M-<f5>" . modus-themes-load-random))
:config
;; Your customizations here. All customizations must evaluated
;; BEFORE loading the theme.
(setq modus-themes-to-toggle '(modus-operandi modus-vivendi)
modus-themes-to-rotate modus-themes-items
modus-themes-mixed-fonts t
modus-themes-variable-pitch-ui t
modus-themes-italic-constructs t
modus-themes-bold-constructs t
modus-themes-completions '((t . (bold)))
modus-themes-prompts '(bold)
modus-themes-headings
'((agenda-structure . (variable-pitch light 2.2))
(agenda-date . (variable-pitch regular 1.3))
(t . (regular 1.15))))
(setq modus-themes-common-palette-overrides nil)
;; Finally, load your theme of choice (or a random one with
;; `modus-themes-load-random', `modus-themes-load-random-dark',
;; `modus-themes-load-random-light').
(modus-themes-load-theme 'modus-operandi))
```
## Links to other projects
In this section I collect links to other themes built on top of Modus,
have Modus as a dependency, or are porting Modus to some other
platform. You are welcome to append your project to the relevant list.
In linking to these projects, I am not endorsing anybody's views.
### Emacs themes based on Modus
This is not an exhaustive list. You are welcome to add your package
here. Newer projects are at the bottom and are added as I am made
aware of them.
- `ef-themes` by Protesilaos <https://github.com/protesilaos/ef-themes>
- `standard-themes` by Protesilaos <https://github.com/protesilaos/standard-themes>
- `modus-ewal-theme` by Oliwier Czerwiński <https://github.com/deadendpl/modus-ewal-theme>
- `modus-flexoki` by Derek Passen <https://github.com/dpassen/modus-flexoki>
- `faff-theme` (since version 4) by James Ferguson <https://github.com/WJCFerguson/emacs-faff-theme>
- `modus-catpuccin` by Magnus Therning <https://gitlab.com/magus/modus-catppuccin>
- `pixel-themes` by Lucas <https://github.com/lucasobx/pixel-themes>
- `modus-nordic` (`modus-nordic-night` and `modus-nordic-midnight`) by Ashton Wiersdorf <https://codeberg.org/ashton314/modus-nordic-night>
- `folio-theme` by kn66 (nobu43) <https://github.com/kn66/folio-theme.el>
- `modus-alabaster` by Derek Passen <https://github.com/dpassen/modus-alabaster>
- `modus-vague` by Ashish Panigrahi <https://github.com/paniash/modus-vague.git>
- `peppers-theme` by Joar von Arndt <https://codeberg.org/joar/peppers-theme>
### Other Emacs packages based on Modus
- `modus-themes-exporter` by Protesilaos <https://github.com/protesilaos/modus-themes-exporter>
### Projects inspired by the Modus themes
This is not an exhaustive list. You are welcome to add your project here.
- `hugo-modus` by Yejun Su is a theme for the Hugo static site
generator: <https://github.com/goofansu/hugo-modus>. It uses colours
from the Modus themes.
- `modus-themes.nvim` by Miika Nissi and others is a port for NeoVim:
<https://github.com/miikanissi/modus-themes.nvim>.
- `zed-modus-themes` by Vitaly Slobodin is a port for the Zed editor:
<https://github.com/vitallium/zed-modus-themes>.
- `word-smith` by Sadsnake1 is a distraction-free writing for Obsidian
that includes ports of the Modus themes: <https://github.com/Sadsnake1/word-smith>
- `omarchy-modus-themes` by Dhavan Vaidya: <https://github.com/codingquark/omarchy-modus-themes>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,9 +1,9 @@
;;; modus-operandi-deuteranopia-theme.el --- Deuteranopia-optimized theme with a white background -*- lexical-binding:t -*-
;; Copyright (C) 2019-2025 Free Software Foundation, Inc.
;; Copyright (C) 2019-2026 Free Software Foundation, Inc.
;; Author: Protesilaos Stavrou <info@protesilaos.com>
;; Maintainer: Protesilaos Stavrou <info@protesilaos.com>
;; Author: Protesilaos <info@protesilaos.com>
;; Maintainer: Protesilaos <info@protesilaos.com>
;; URL: https://github.com/protesilaos/modus-themes
;; Keywords: faces, theme, accessibility
@ -26,490 +26,35 @@
;;
;; The Modus themes conform with the highest standard for
;; color-contrast accessibility between background and foreground
;; values (WCAG AAA). Please refer to the official Info manual for
;; further documentation (distributed with the themes, or available
;; at: <https://protesilaos.com/emacs/modus-themes>).
;; values (WCAG AAA). They are also highly customizable and can even
;; be used as the basis for other themes. Please refer to the official
;; Info manual for further documentation (distributed with the themes,
;; or available at: <https://protesilaos.com/emacs/modus-themes>).
;;; Code:
(eval-and-compile
(unless (and (fboundp 'require-theme)
load-file-name
(equal (file-name-directory load-file-name)
(expand-file-name "themes/" data-directory))
(require-theme 'modus-themes t))
(require 'modus-themes))
;;;###theme-autoload
(deftheme modus-operandi-deuteranopia
"Deuteranopia-optimized theme with a white background.
This variant is optimized for users with red-green color
deficiency (deuteranopia). It conforms with the highest
legibility standard for color contrast between background and
foreground in any given piece of text, which corresponds to a
minimum contrast in relative luminance of 7:1 (WCAG AAA
standard)."
:background-mode 'light
:kind 'color-scheme
:family 'modus)
(defconst modus-operandi-deuteranopia-palette
'(
;;; Basic values
(bg-main "#ffffff")
(bg-dim "#f2f2f2")
(fg-main "#000000")
(fg-dim "#595959")
(fg-alt "#193668")
(bg-active "#c4c4c4")
(bg-inactive "#e0e0e0")
(border "#9f9f9f")
;;; Common accent foregrounds
(red "#a60000")
(red-warmer "#972500")
(red-cooler "#a0132f")
(red-faint "#7f0000")
(red-intense "#d00000")
(green "#006800")
(green-warmer "#316500")
(green-cooler "#00663f")
(green-faint "#2a5045")
(green-intense "#008900")
(yellow "#695500")
(yellow-warmer "#973300")
(yellow-cooler "#77492f")
(yellow-faint "#624416")
(yellow-intense "#808000")
(blue "#0031a9")
(blue-warmer "#3548cf")
(blue-cooler "#0000b0")
(blue-faint "#003497")
(blue-intense "#0000ff")
(magenta "#721045")
(magenta-warmer "#8f0075")
(magenta-cooler "#531ab6")
(magenta-faint "#7c318f")
(magenta-intense "#dd22dd")
(cyan "#005e8b")
(cyan-warmer "#3f578f")
(cyan-cooler "#005f5f")
(cyan-faint "#005077")
(cyan-intense "#008899")
;;; Uncommon accent foregrounds
(rust "#8a290f")
(gold "#80601f")
(olive "#56692d")
(slate "#2f3f83")
(indigo "#4a3a8a")
(maroon "#731c52")
(pink "#7b435c")
;;; Common accent backgrounds
(bg-red-intense "#ff8f88")
(bg-green-intense "#8adf80")
(bg-yellow-intense "#f3d000")
(bg-blue-intense "#bfc9ff")
(bg-magenta-intense "#dfa0f0")
(bg-cyan-intense "#a4d5f9")
(bg-red-subtle "#ffcfbf")
(bg-green-subtle "#b3fabf")
(bg-yellow-subtle "#fff576")
(bg-blue-subtle "#ccdfff")
(bg-magenta-subtle "#ffddff")
(bg-cyan-subtle "#bfefff")
(bg-red-nuanced "#ffe8e8")
(bg-green-nuanced "#e0f6e0")
(bg-yellow-nuanced "#f8f0d0")
(bg-blue-nuanced "#ecedff")
(bg-magenta-nuanced "#f8e6f5")
(bg-cyan-nuanced "#e0f2fa")
;;; Uncommon accent background and foreground pairs
(bg-clay "#f1c8b5")
(fg-clay "#63192a")
(bg-ochre "#f0e3c0")
(fg-ochre "#573a30")
(bg-lavender "#dfcdfa")
(fg-lavender "#443379")
(bg-sage "#c0e7d4")
(fg-sage "#124b41")
;;; Graphs
(bg-graph-red-0 "#d0b029")
(bg-graph-red-1 "#e0cab4")
(bg-graph-green-0 "#8ac050")
(bg-graph-green-1 "#afdfa5")
(bg-graph-yellow-0 "#ffcf00")
(bg-graph-yellow-1 "#f9ff00")
(bg-graph-blue-0 "#7f9fff")
(bg-graph-blue-1 "#afd0ff")
(bg-graph-magenta-0 "#b0b0d0")
(bg-graph-magenta-1 "#d0dfdf")
(bg-graph-cyan-0 "#6faad9")
(bg-graph-cyan-1 "#bfe0ff")
;;; Special purpose
(bg-completion "#c0deff")
(bg-hover "#b2e4dc")
(bg-hover-secondary "#e5d7a0")
(bg-hl-line "#dae5ec")
(bg-region "#bdbdbd")
(fg-region "#000000")
(bg-mode-line-active "#d0d6ff")
(fg-mode-line-active "#0f0f0f")
(border-mode-line-active "#4f4f74")
(bg-mode-line-inactive "#e6e6e6")
(fg-mode-line-inactive "#585858")
(border-mode-line-inactive "#a3a3a3")
(modeline-err "#603a00")
(modeline-warning "#454500")
(modeline-info "#023d92")
(bg-tab-bar "#dfdfdf")
(bg-tab-current "#ffffff")
(bg-tab-other "#c2c2c2")
;;; Diffs
(bg-added "#d5d7ff")
(bg-added-faint "#e6e6ff")
(bg-added-refine "#babcef")
(bg-added-fringe "#275acc")
(fg-added "#303099")
(fg-added-intense "#0303cc")
(bg-changed "#eecfdf")
(bg-changed-faint "#f0dde5")
(bg-changed-refine "#e0b0d0")
(bg-changed-fringe "#9f6ab0")
(fg-changed "#6f1343")
(fg-changed-intense "#7f0f9f")
(bg-removed "#f4f099")
(bg-removed-faint "#f6f6b7")
(bg-removed-refine "#ede06f")
(bg-removed-fringe "#c0b200")
(fg-removed "#553d00")
(fg-removed-intense "#7f6f00")
(bg-diff-context "#f3f3f3")
;;; Paren match
(bg-paren-match "#5fcfff")
(fg-paren-match fg-main)
(bg-paren-expression "#efd3f5")
(underline-paren-match unspecified)
;;; Mappings
;;;; General mappings
(fringe bg-dim)
(cursor blue-intense)
(keybind blue-cooler)
(name blue-cooler)
(identifier yellow-faint)
(err yellow-warmer)
(warning yellow)
(info blue)
(underline-err yellow-intense)
(underline-warning magenta-faint)
(underline-note cyan)
(bg-prominent-err bg-yellow-intense)
(fg-prominent-err fg-main)
(bg-prominent-warning bg-magenta-intense)
(fg-prominent-warning fg-main)
(bg-prominent-note bg-cyan-intense)
(fg-prominent-note fg-main)
(bg-active-argument bg-yellow-nuanced)
(fg-active-argument yellow-warmer)
(bg-active-value bg-blue-nuanced)
(fg-active-value blue-warmer)
;;;; Code mappings
(bracket fg-main)
(builtin yellow)
(comment yellow-cooler)
(constant blue-faint)
(delimiter fg-main)
(docmarkup magenta-faint)
(docstring green-faint)
(fnname yellow-warmer)
(keyword blue-cooler)
(number fg-main)
(operator fg-main)
(preprocessor magenta-cooler)
(property cyan)
(punctuation fg-main)
(rx-backslash blue-cooler)
(rx-construct yellow-cooler)
(string blue-warmer)
(type cyan-cooler)
(variable cyan)
;;;; Accent mappings
(accent-0 blue-warmer)
(accent-1 yellow-warmer)
(accent-2 cyan)
(accent-3 yellow-cooler)
;;;; Button mappings
(fg-button-active fg-main)
(fg-button-inactive fg-dim)
(bg-button-active bg-active)
(bg-button-inactive bg-dim)
;;;; Completion mappings
(fg-completion-match-0 blue-warmer)
(fg-completion-match-1 yellow-warmer)
(fg-completion-match-2 cyan)
(fg-completion-match-3 yellow-cooler)
(bg-completion-match-0 unspecified)
(bg-completion-match-1 unspecified)
(bg-completion-match-2 unspecified)
(bg-completion-match-3 unspecified)
;;;; Date mappings
(date-common cyan)
(date-deadline yellow-warmer)
(date-deadline-subtle red-faint)
(date-event fg-alt)
(date-holiday yellow-warmer)
(date-holiday-other blue)
(date-now fg-main)
(date-range fg-alt)
(date-scheduled yellow-cooler)
(date-scheduled-subtle yellow-faint)
(date-weekday cyan)
(date-weekend blue-cooler)
;;;; Line number mappings
(fg-line-number-inactive fg-dim)
(fg-line-number-active fg-main)
(bg-line-number-inactive bg-dim)
(bg-line-number-active bg-active)
;;;; Link mappings
(fg-link blue-warmer)
(bg-link unspecified)
(underline-link blue-warmer)
(fg-link-symbolic cyan)
(bg-link-symbolic unspecified)
(underline-link-symbolic cyan)
(fg-link-visited yellow-faint)
(bg-link-visited unspecified)
(underline-link-visited yellow-faint)
;;;; Mail mappings
(mail-cite-0 blue-warmer)
(mail-cite-1 yellow)
(mail-cite-2 cyan-faint)
(mail-cite-3 yellow-faint)
(mail-part blue)
(mail-recipient blue)
(mail-subject yellow-cooler)
(mail-other cyan-faint)
;;;; Mark mappings
(bg-mark-delete bg-yellow-subtle)
(fg-mark-delete yellow)
(bg-mark-select bg-cyan-subtle)
(fg-mark-select cyan)
(bg-mark-other bg-magenta-subtle)
(fg-mark-other magenta)
;;;; Prompt mappings
(fg-prompt blue)
(bg-prompt unspecified)
;;;; Prose mappings
(bg-prose-block-delimiter bg-dim)
(fg-prose-block-delimiter fg-dim)
(bg-prose-block-contents bg-dim)
(bg-prose-code unspecified)
(fg-prose-code cyan-cooler)
(bg-prose-macro unspecified)
(fg-prose-macro magenta-cooler)
(bg-prose-verbatim unspecified)
(fg-prose-verbatim yellow)
(prose-done blue)
(prose-todo yellow-warmer)
(prose-metadata fg-dim)
(prose-metadata-value fg-alt)
(prose-table fg-alt)
(prose-table-formula yellow-warmer)
(prose-tag fg-alt)
;;;; Rainbow mappings
(rainbow-0 blue)
(rainbow-1 yellow)
(rainbow-2 blue-warmer)
(rainbow-3 yellow-cooler)
(rainbow-4 blue-cooler)
(rainbow-5 yellow-warmer)
(rainbow-6 blue-faint)
(rainbow-7 yellow-faint)
(rainbow-8 cyan)
;;;; Search mappings
(bg-search-current bg-yellow-intense)
(bg-search-lazy bg-blue-intense)
(bg-search-replace bg-yellow-intense)
(bg-search-rx-group-0 bg-cyan-intense)
(bg-search-rx-group-1 bg-magenta-intense)
(bg-search-rx-group-2 bg-blue-subtle)
(bg-search-rx-group-3 bg-yellow-subtle)
;;;; Space mappings
(bg-space unspecified)
(fg-space border)
(bg-space-err bg-yellow-intense)
;;;; Terminal mappings
(bg-term-black "#000000")
(fg-term-black "#000000")
(bg-term-black-bright "#595959")
(fg-term-black-bright "#595959")
(bg-term-red red)
(fg-term-red red)
(bg-term-red-bright red-warmer)
(fg-term-red-bright red-warmer)
(bg-term-green green)
(fg-term-green green)
(bg-term-green-bright green-cooler)
(fg-term-green-bright green-cooler)
(bg-term-yellow yellow)
(fg-term-yellow yellow)
(bg-term-yellow-bright yellow-warmer)
(fg-term-yellow-bright yellow-warmer)
(bg-term-blue blue)
(fg-term-blue blue)
(bg-term-blue-bright blue-warmer)
(fg-term-blue-bright blue-warmer)
(bg-term-magenta magenta)
(fg-term-magenta magenta)
(bg-term-magenta-bright magenta-cooler)
(fg-term-magenta-bright magenta-cooler)
(bg-term-cyan cyan)
(fg-term-cyan cyan)
(bg-term-cyan-bright cyan-cooler)
(fg-term-cyan-bright cyan-cooler)
(bg-term-white "#a6a6a6")
(fg-term-white "#a6a6a6")
(bg-term-white-bright "#ffffff")
(fg-term-white-bright "#ffffff")
;;;; Heading mappings
(fg-heading-0 cyan-cooler)
(fg-heading-1 fg-main)
(fg-heading-2 yellow-faint)
(fg-heading-3 blue-faint)
(fg-heading-4 green-faint)
(fg-heading-5 magenta-cooler)
(fg-heading-6 yellow-cooler)
(fg-heading-7 cyan)
(fg-heading-8 fg-dim)
(bg-heading-0 unspecified)
(bg-heading-1 unspecified)
(bg-heading-2 unspecified)
(bg-heading-3 unspecified)
(bg-heading-4 unspecified)
(bg-heading-5 unspecified)
(bg-heading-6 unspecified)
(bg-heading-7 unspecified)
(bg-heading-8 unspecified)
(overline-heading-0 unspecified)
(overline-heading-1 unspecified)
(overline-heading-2 unspecified)
(overline-heading-3 unspecified)
(overline-heading-4 unspecified)
(overline-heading-5 unspecified)
(overline-heading-6 unspecified)
(overline-heading-7 unspecified)
(overline-heading-8 unspecified))
"The entire palette of the `modus-operandi-deuteranopia' theme.
Named colors have the form (COLOR-NAME HEX-VALUE) with the former
as a symbol and the latter as a string.
Semantic color mappings have the form (MAPPING-NAME COLOR-NAME)
with both as symbols. The latter is a named color that already
exists in the palette and is associated with a HEX-VALUE.")
(defcustom modus-operandi-deuteranopia-palette-user nil
"Like the `modus-operandi-deuteranopia-palette' for user-defined entries.
(unless (and (fboundp 'require-theme)
load-file-name
(equal (file-name-directory load-file-name)
(expand-file-name "themes/" data-directory))
(require-theme 'modus-themes t))
(require 'modus-themes))
(defcustom modus-operandi-deuteranopia-palette-user nil
"Like the `modus-operandi-deuteranopia-palette' for user-defined entries.
This is meant to extend the palette with custom named colors and/or
semantic palette mappings. Those may then be used in combination with
palette overrides (also see `modus-themes-common-palette-overrides' and
`modus-operandi-deuteranopia-palette-overrides')."
:group 'modus-themes
:package-version '(modus-themes . "4.5.0")
:type '(repeat (list symbol (choice symbol string)))
:set #'modus-themes--set-option
:initialize #'custom-initialize-default
:link '(info-link "(modus-themes) Option to extend the palette for use with overrides"))
:group 'modus-themes
:package-version '(modus-themes . "4.5.0")
:type '(repeat (list symbol (choice symbol string)))
:link '(info-link "(modus-themes) Option to extend the palette for use with overrides"))
(defcustom modus-operandi-deuteranopia-palette-overrides nil
"Overrides for `modus-operandi-deuteranopia-palette'.
(defcustom modus-operandi-deuteranopia-palette-overrides nil
"Overrides for `modus-operandi-deuteranopia-palette'.
Mirror the elements of the aforementioned palette, overriding
their value.
@ -523,18 +68,28 @@ mappings, such as to make the cursor red. Wherea theme-specific
overrides can also be used to change the value of a named color,
such as what hexadecimal RGB value the red-warmer symbol
represents."
:group 'modus-themes
:package-version '(modus-themes . "4.0.0")
:version "30.1"
:type '(repeat (list symbol (choice symbol string)))
:set #'modus-themes--set-option
:initialize #'custom-initialize-default
:link '(info-link "(modus-themes) Palette overrides"))
:group 'modus-themes
:package-version '(modus-themes . "4.0.0")
:version "30.1"
:type '(repeat (list symbol (choice symbol string)))
:link '(info-link "(modus-themes) Palette overrides"))
(modus-themes-theme modus-operandi-deuteranopia
modus-operandi-deuteranopia-palette
modus-operandi-deuteranopia-palette-overrides)
(modus-themes-theme
'modus-operandi-deuteranopia
'modus-themes
"Deuteranopia-optimized theme with a white background.
This variant is optimized for users with red-green color
deficiency (deuteranopia). It conforms with the highest
legibility standard for color contrast between background and
foreground in any given piece of text, which corresponds to a
minimum contrast in relative luminance of 7:1 (WCAG AAA
standard)."
'light
'modus-themes-operandi-deuteranopia-palette
'modus-operandi-deuteranopia-palette-user
'modus-operandi-deuteranopia-palette-overrides
'modus-themes-faces-deuteranopia)
(provide-theme 'modus-operandi-deuteranopia))
(provide 'modus-operandi-deuteranopia-theme)
;;; modus-operandi-deuteranopia-theme.el ends here

View file

@ -1,9 +1,9 @@
;;; modus-operandi-theme.el --- Elegant, highly legible theme with a white background -*- lexical-binding:t -*-
;; Copyright (C) 2019-2025 Free Software Foundation, Inc.
;; Copyright (C) 2019-2026 Free Software Foundation, Inc.
;; Author: Protesilaos Stavrou <info@protesilaos.com>
;; Maintainer: Protesilaos Stavrou <info@protesilaos.com>
;; Author: Protesilaos <info@protesilaos.com>
;; Maintainer: Protesilaos <info@protesilaos.com>
;; URL: https://github.com/protesilaos/modus-themes
;; Keywords: faces, theme, accessibility
@ -26,488 +26,35 @@
;;
;; The Modus themes conform with the highest standard for
;; color-contrast accessibility between background and foreground
;; values (WCAG AAA). Please refer to the official Info manual for
;; further documentation (distributed with the themes, or available
;; at: <https://protesilaos.com/emacs/modus-themes>).
;; values (WCAG AAA). They are also highly customizable and can even
;; be used as the basis for other themes. Please refer to the official
;; Info manual for further documentation (distributed with the themes,
;; or available at: <https://protesilaos.com/emacs/modus-themes>).
;;; Code:
(eval-and-compile
(unless (and (fboundp 'require-theme)
load-file-name
(equal (file-name-directory load-file-name)
(expand-file-name "themes/" data-directory))
(require-theme 'modus-themes t))
(require 'modus-themes))
;;;###theme-autoload
(deftheme modus-operandi
"Elegant, highly legible theme with a white background.
Conforms with the highest legibility standard for color contrast
between background and foreground in any given piece of text,
which corresponds to a minimum contrast in relative luminance of
7:1 (WCAG AAA standard)."
:background-mode 'light
:kind 'color-scheme
:family 'modus)
(defconst modus-operandi-palette
'(
;;; Basic values
(bg-main "#ffffff")
(bg-dim "#f2f2f2")
(fg-main "#000000")
(fg-dim "#595959")
(fg-alt "#193668")
(bg-active "#c4c4c4")
(bg-inactive "#e0e0e0")
(border "#9f9f9f")
;;; Common accent foregrounds
(red "#a60000")
(red-warmer "#972500")
(red-cooler "#a0132f")
(red-faint "#7f0000")
(red-intense "#d00000")
(green "#006800")
(green-warmer "#316500")
(green-cooler "#00663f")
(green-faint "#2a5045")
(green-intense "#008900")
(yellow "#6f5500")
(yellow-warmer "#884900")
(yellow-cooler "#7a4f2f")
(yellow-faint "#624416")
(yellow-intense "#808000")
(blue "#0031a9")
(blue-warmer "#3548cf")
(blue-cooler "#0000b0")
(blue-faint "#003497")
(blue-intense "#0000ff")
(magenta "#721045")
(magenta-warmer "#8f0075")
(magenta-cooler "#531ab6")
(magenta-faint "#7c318f")
(magenta-intense "#dd22dd")
(cyan "#005e8b")
(cyan-warmer "#3f578f")
(cyan-cooler "#005f5f")
(cyan-faint "#005077")
(cyan-intense "#008899")
;;; Uncommon accent foregrounds
(rust "#8a290f")
(gold "#80601f")
(olive "#56692d")
(slate "#2f3f83")
(indigo "#4a3a8a")
(maroon "#731c52")
(pink "#7b435c")
;;; Common accent backgrounds
(bg-red-intense "#ff8f88")
(bg-green-intense "#8adf80")
(bg-yellow-intense "#f3d000")
(bg-blue-intense "#bfc9ff")
(bg-magenta-intense "#dfa0f0")
(bg-cyan-intense "#a4d5f9")
(bg-red-subtle "#ffcfbf")
(bg-green-subtle "#b3fabf")
(bg-yellow-subtle "#fff576")
(bg-blue-subtle "#ccdfff")
(bg-magenta-subtle "#ffddff")
(bg-cyan-subtle "#bfefff")
(bg-red-nuanced "#ffe8e8")
(bg-green-nuanced "#e0f6e0")
(bg-yellow-nuanced "#f8f0d0")
(bg-blue-nuanced "#ecedff")
(bg-magenta-nuanced "#f8e6f5")
(bg-cyan-nuanced "#e0f2fa")
;;; Uncommon accent background and foreground pairs
(bg-clay "#f1c8b5")
(fg-clay "#63192a")
(bg-ochre "#f0e3c0")
(fg-ochre "#573a30")
(bg-lavender "#dfcdfa")
(fg-lavender "#443379")
(bg-sage "#c0e7d4")
(fg-sage "#124b41")
;;; Graphs
(bg-graph-red-0 "#ef7969")
(bg-graph-red-1 "#ffaab4")
(bg-graph-green-0 "#45c050")
(bg-graph-green-1 "#75ef30")
(bg-graph-yellow-0 "#ffcf00")
(bg-graph-yellow-1 "#f9ff00")
(bg-graph-blue-0 "#7f90ff")
(bg-graph-blue-1 "#a6c0ff")
(bg-graph-magenta-0 "#e07fff")
(bg-graph-magenta-1 "#fad0ff")
(bg-graph-cyan-0 "#70d3f0")
(bg-graph-cyan-1 "#afefff")
;;; Special purpose
(bg-completion "#c0deff")
(bg-hover "#b2e4dc")
(bg-hover-secondary "#f5d0a0")
(bg-hl-line "#dae5ec")
(bg-region "#bdbdbd")
(fg-region "#000000")
(bg-mode-line-active "#c8c8c8")
(fg-mode-line-active "#000000")
(border-mode-line-active "#5a5a5a")
(bg-mode-line-inactive "#e6e6e6")
(fg-mode-line-inactive "#585858")
(border-mode-line-inactive "#a3a3a3")
(modeline-err "#7f0000")
(modeline-warning "#5f0070")
(modeline-info "#002580")
(bg-tab-bar "#dfdfdf")
(bg-tab-current "#ffffff")
(bg-tab-other "#c2c2c2")
;;; Diffs
(bg-added "#c1f2d1")
(bg-added-faint "#d8f8e1")
(bg-added-refine "#aee5be")
(bg-added-fringe "#6cc06c")
(fg-added "#005000")
(fg-added-intense "#006700")
(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")
(bg-diff-context "#f3f3f3")
;;; Paren match
(bg-paren-match "#5fcfff")
(fg-paren-match fg-main)
(bg-paren-expression "#efd3f5")
(underline-paren-match unspecified)
;;; Mappings
;;;; General mappings
(fringe bg-dim)
(cursor fg-main)
(keybind blue-cooler)
(name magenta)
(identifier yellow-cooler)
(err red)
(warning yellow-warmer)
(info cyan-cooler)
(underline-err red-intense)
(underline-warning yellow-intense)
(underline-note cyan-intense)
(bg-prominent-err bg-red-intense)
(fg-prominent-err fg-main)
(bg-prominent-warning bg-yellow-intense)
(fg-prominent-warning fg-main)
(bg-prominent-note bg-cyan-intense)
(fg-prominent-note fg-main)
(bg-active-argument bg-yellow-nuanced)
(fg-active-argument yellow-warmer)
(bg-active-value bg-cyan-nuanced)
(fg-active-value cyan-warmer)
;;;; Code mappings
(bracket fg-main)
(builtin magenta-warmer)
(comment fg-dim)
(constant blue-cooler)
(delimiter fg-main)
(docmarkup magenta-faint)
(docstring green-faint)
(fnname magenta)
(keyword magenta-cooler)
(number fg-main)
(operator fg-main)
(preprocessor red-cooler)
(property cyan)
(punctuation fg-main)
(rx-backslash magenta)
(rx-construct green-cooler)
(string blue-warmer)
(type cyan-cooler)
(variable cyan)
;;;; Accent mappings
(accent-0 blue)
(accent-1 magenta-warmer)
(accent-2 cyan)
(accent-3 red)
;;;; Button mappings
(fg-button-active fg-main)
(fg-button-inactive fg-dim)
(bg-button-active bg-active)
(bg-button-inactive bg-dim)
;;;; Completion mappings
(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 unspecified)
(bg-completion-match-1 unspecified)
(bg-completion-match-2 unspecified)
(bg-completion-match-3 unspecified)
;;;; Date mappings
(date-common cyan)
(date-deadline red-cooler)
(date-deadline-subtle red-faint)
(date-event fg-alt)
(date-holiday red)
(date-holiday-other blue)
(date-now fg-main)
(date-range fg-alt)
(date-scheduled yellow)
(date-scheduled-subtle yellow-faint)
(date-weekday cyan)
(date-weekend magenta)
;;;; Line number mappings
(fg-line-number-inactive fg-dim)
(fg-line-number-active fg-main)
(bg-line-number-inactive bg-dim)
(bg-line-number-active bg-active)
;;;; Link mappings
(fg-link blue-warmer)
(bg-link unspecified)
(underline-link blue-warmer)
(fg-link-symbolic cyan)
(bg-link-symbolic unspecified)
(underline-link-symbolic cyan)
(fg-link-visited magenta)
(bg-link-visited unspecified)
(underline-link-visited magenta)
;;;; Mail mappings
(mail-cite-0 blue-faint)
(mail-cite-1 yellow-warmer)
(mail-cite-2 cyan-cooler)
(mail-cite-3 red-cooler)
(mail-part cyan)
(mail-recipient magenta-cooler)
(mail-subject magenta-warmer)
(mail-other magenta-faint)
;;;; Mark mappings
(bg-mark-delete bg-red-subtle)
(fg-mark-delete red)
(bg-mark-select bg-cyan-subtle)
(fg-mark-select cyan)
(bg-mark-other bg-yellow-subtle)
(fg-mark-other yellow)
;;;; Prompt mappings
(fg-prompt cyan-cooler)
(bg-prompt unspecified)
;;;; Prose mappings
(bg-prose-block-delimiter bg-dim)
(fg-prose-block-delimiter fg-dim)
(bg-prose-block-contents bg-dim)
(bg-prose-code unspecified)
(fg-prose-code cyan-cooler)
(bg-prose-macro unspecified)
(fg-prose-macro magenta-cooler)
(bg-prose-verbatim unspecified)
(fg-prose-verbatim magenta-warmer)
(prose-done green)
(prose-todo red)
(prose-metadata fg-dim)
(prose-metadata-value fg-alt)
(prose-table fg-alt)
(prose-table-formula magenta-warmer)
(prose-tag magenta-faint)
;;;; Rainbow mappings
(rainbow-0 fg-main)
(rainbow-1 magenta-intense)
(rainbow-2 cyan-intense)
(rainbow-3 red-warmer)
(rainbow-4 yellow-intense)
(rainbow-5 magenta-cooler)
(rainbow-6 green-intense)
(rainbow-7 blue-warmer)
(rainbow-8 magenta-warmer)
;;;; Search mappings
(bg-search-current bg-yellow-intense)
(bg-search-lazy bg-cyan-intense)
(bg-search-replace bg-red-intense)
(bg-search-rx-group-0 bg-blue-intense)
(bg-search-rx-group-1 bg-green-intense)
(bg-search-rx-group-2 bg-red-subtle)
(bg-search-rx-group-3 bg-magenta-subtle)
;;;; Space mappings
(bg-space unspecified)
(fg-space border)
(bg-space-err bg-red-intense)
;;;; Terminal mappings
(bg-term-black "#000000")
(fg-term-black "#000000")
(bg-term-black-bright "#595959")
(fg-term-black-bright "#595959")
(bg-term-red red)
(fg-term-red red)
(bg-term-red-bright red-warmer)
(fg-term-red-bright red-warmer)
(bg-term-green green)
(fg-term-green green)
(bg-term-green-bright green-cooler)
(fg-term-green-bright green-cooler)
(bg-term-yellow yellow)
(fg-term-yellow yellow)
(bg-term-yellow-bright yellow-warmer)
(fg-term-yellow-bright yellow-warmer)
(bg-term-blue blue)
(fg-term-blue blue)
(bg-term-blue-bright blue-warmer)
(fg-term-blue-bright blue-warmer)
(bg-term-magenta magenta)
(fg-term-magenta magenta)
(bg-term-magenta-bright magenta-cooler)
(fg-term-magenta-bright magenta-cooler)
(bg-term-cyan cyan)
(fg-term-cyan cyan)
(bg-term-cyan-bright cyan-cooler)
(fg-term-cyan-bright cyan-cooler)
(bg-term-white "#a6a6a6")
(fg-term-white "#a6a6a6")
(bg-term-white-bright "#ffffff")
(fg-term-white-bright "#ffffff")
;;;; Heading mappings
(fg-heading-0 cyan-cooler)
(fg-heading-1 fg-main)
(fg-heading-2 yellow-faint)
(fg-heading-3 fg-alt)
(fg-heading-4 magenta)
(fg-heading-5 green-faint)
(fg-heading-6 red-faint)
(fg-heading-7 cyan-warmer)
(fg-heading-8 fg-dim)
(bg-heading-0 unspecified)
(bg-heading-1 unspecified)
(bg-heading-2 unspecified)
(bg-heading-3 unspecified)
(bg-heading-4 unspecified)
(bg-heading-5 unspecified)
(bg-heading-6 unspecified)
(bg-heading-7 unspecified)
(bg-heading-8 unspecified)
(overline-heading-0 unspecified)
(overline-heading-1 unspecified)
(overline-heading-2 unspecified)
(overline-heading-3 unspecified)
(overline-heading-4 unspecified)
(overline-heading-5 unspecified)
(overline-heading-6 unspecified)
(overline-heading-7 unspecified)
(overline-heading-8 unspecified))
"The entire palette of the `modus-operandi' theme.
Named colors have the form (COLOR-NAME HEX-VALUE) with the former
as a symbol and the latter as a string.
Semantic color mappings have the form (MAPPING-NAME COLOR-NAME)
with both as symbols. The latter is a named color that already
exists in the palette and is associated with a HEX-VALUE.")
(defcustom modus-operandi-palette-user nil
"Like the `modus-operandi-palette' for user-defined entries.
(unless (and (fboundp 'require-theme)
load-file-name
(equal (file-name-directory load-file-name)
(expand-file-name "themes/" data-directory))
(require-theme 'modus-themes t))
(require 'modus-themes))
(defcustom modus-operandi-palette-user nil
"Like the `modus-operandi-palette' for user-defined entries.
This is meant to extend the palette with custom named colors and/or
semantic palette mappings. Those may then be used in combination with
palette overrides (also see `modus-themes-common-palette-overrides' and
`modus-operandi-palette-overrides')."
:group 'modus-themes
:package-version '(modus-themes . "4.5.0")
:type '(repeat (list symbol (choice symbol string)))
:set #'modus-themes--set-option
:initialize #'custom-initialize-default
:link '(info-link "(modus-themes) Option to extend the palette for use with overrides"))
:group 'modus-themes
:package-version '(modus-themes . "4.5.0")
:type '(repeat (list symbol (choice symbol string)))
:link '(info-link "(modus-themes) Option to extend the palette for use with overrides"))
(defcustom modus-operandi-palette-overrides nil
"Overrides for `modus-operandi-palette'.
(defcustom modus-operandi-palette-overrides nil
"Overrides for `modus-operandi-palette'.
Mirror the elements of the aforementioned palette, overriding
their value.
@ -521,18 +68,25 @@ mappings, such as to make the cursor red. Wherea theme-specific
overrides can also be used to change the value of a named color,
such as what hexadecimal RGB value the red-warmer symbol
represents."
:group 'modus-themes
:package-version '(modus-themes . "4.0.0")
:version "30.1"
:type '(repeat (list symbol (choice symbol string)))
:set #'modus-themes--set-option
:initialize #'custom-initialize-default
:link '(info-link "(modus-themes) Palette overrides"))
:group 'modus-themes
:package-version '(modus-themes . "4.0.0")
:version "30.1"
:type '(repeat (list symbol (choice symbol string)))
:link '(info-link "(modus-themes) Palette overrides"))
(modus-themes-theme modus-operandi
modus-operandi-palette
modus-operandi-palette-overrides)
(modus-themes-theme
'modus-operandi
'modus-themes
"Elegant, highly legible theme with a white background.
Conforms with the highest legibility standard for color contrast
between background and foreground in any given piece of text,
which corresponds to a minimum contrast in relative luminance of
7:1 (WCAG AAA standard)."
'light
'modus-themes-operandi-palette
'modus-operandi-palette-user
'modus-operandi-palette-overrides)
(provide-theme 'modus-operandi))
(provide 'modus-operandi-theme)
;;; modus-operandi-theme.el ends here

View file

@ -1,9 +1,9 @@
;;; modus-operandi-tinted-theme.el --- Elegant, highly legible theme with a light ochre background -*- lexical-binding:t -*-
;; Copyright (C) 2019-2025 Free Software Foundation, Inc.
;; Copyright (C) 2019-2026 Free Software Foundation, Inc.
;; Author: Protesilaos Stavrou <info@protesilaos.com>
;; Maintainer: Protesilaos Stavrou <info@protesilaos.com>
;; Author: Protesilaos <info@protesilaos.com>
;; Maintainer: Protesilaos <info@protesilaos.com>
;; URL: https://github.com/protesilaos/modus-themes
;; Keywords: faces, theme, accessibility
@ -26,488 +26,35 @@
;;
;; The Modus themes conform with the highest standard for
;; color-contrast accessibility between background and foreground
;; values (WCAG AAA). Please refer to the official Info manual for
;; further documentation (distributed with the themes, or available
;; at: <https://protesilaos.com/emacs/modus-themes>).
;; values (WCAG AAA). They are also highly customizable and can even
;; be used as the basis for other themes. Please refer to the official
;; Info manual for further documentation (distributed with the themes,
;; or available at: <https://protesilaos.com/emacs/modus-themes>).
;;; Code:
(eval-and-compile
(unless (and (fboundp 'require-theme)
load-file-name
(equal (file-name-directory load-file-name)
(expand-file-name "themes/" data-directory))
(require-theme 'modus-themes t))
(require 'modus-themes))
;;;###theme-autoload
(deftheme modus-operandi-tinted
"Elegant, highly legible theme with a light ochre background.
Conforms with the highest legibility standard for color contrast
between background and foreground in any given piece of text,
which corresponds to a minimum contrast in relative luminance of
7:1 (WCAG AAA standard)."
:background-mode 'light
:kind 'color-scheme
:family 'modus)
(defconst modus-operandi-tinted-palette
'(
;;; Basic values
(bg-main "#fbf7f0")
(bg-dim "#efe9dd")
(fg-main "#000000")
(fg-dim "#595959")
(fg-alt "#193668")
(bg-active "#c9b9b0")
(bg-inactive "#dfd5cf")
(border "#9f9690")
;;; Common accent foregrounds
(red "#a60000")
(red-warmer "#972500")
(red-cooler "#a0132f")
(red-faint "#7f0000")
(red-intense "#d00000")
(green "#006300")
(green-warmer "#306010")
(green-cooler "#00603f")
(green-faint "#2a5045")
(green-intense "#008900")
(yellow "#6d5000")
(yellow-warmer "#894000")
(yellow-cooler "#602938")
(yellow-faint "#574316")
(yellow-intense "#808000")
(blue "#0031a9")
(blue-warmer "#3546c2")
(blue-cooler "#0000b0")
(blue-faint "#003497")
(blue-intense "#0000ff")
(magenta "#721045")
(magenta-warmer "#8f0075")
(magenta-cooler "#531ab6")
(magenta-faint "#7c318f")
(magenta-intense "#dd22dd")
(cyan "#00598b")
(cyan-warmer "#32548f")
(cyan-cooler "#005f5f")
(cyan-faint "#304463")
(cyan-intense "#008899")
;;; Uncommon accent foregrounds
(rust "#8a290f")
(gold "#80601f")
(olive "#56692d")
(slate "#2f3f83")
(indigo "#4a3a8a")
(maroon "#731c52")
(pink "#7b435c")
;;; Common accent backgrounds
(bg-red-intense "#ff8f88")
(bg-green-intense "#8adf80")
(bg-yellow-intense "#f3d000")
(bg-blue-intense "#bfc9ff")
(bg-magenta-intense "#dfa0f0")
(bg-cyan-intense "#a4d5f9")
(bg-red-subtle "#ffcfbf")
(bg-green-subtle "#b3fabf")
(bg-yellow-subtle "#fff576")
(bg-blue-subtle "#ccdfff")
(bg-magenta-subtle "#ffddff")
(bg-cyan-subtle "#bfefff")
(bg-red-nuanced "#ffe8e8")
(bg-green-nuanced "#e0f6e0")
(bg-yellow-nuanced "#f8f0d0")
(bg-blue-nuanced "#ecedff")
(bg-magenta-nuanced "#f8e6f5")
(bg-cyan-nuanced "#e0f2fa")
;;; Uncommon accent background and foreground pairs
(bg-clay "#f1c8b5")
(fg-clay "#63192a")
(bg-ochre "#f0e3c0")
(fg-ochre "#573a30")
(bg-lavender "#dfcdfa")
(fg-lavender "#443379")
(bg-sage "#c0e7d4")
(fg-sage "#124b41")
;;; Graphs
(bg-graph-red-0 "#ef7969")
(bg-graph-red-1 "#ffaab4")
(bg-graph-green-0 "#45c050")
(bg-graph-green-1 "#75ef30")
(bg-graph-yellow-0 "#ffcf00")
(bg-graph-yellow-1 "#f9ff00")
(bg-graph-blue-0 "#7f90ff")
(bg-graph-blue-1 "#a6c0ff")
(bg-graph-magenta-0 "#e07fff")
(bg-graph-magenta-1 "#fad0ff")
(bg-graph-cyan-0 "#70d3f0")
(bg-graph-cyan-1 "#afefff")
;;; Special purpose
(bg-completion "#f0c1cf")
(bg-hover "#b2e4dc")
(bg-hover-secondary "#dfe09f")
(bg-hl-line "#f1d5d0")
(bg-region "#c2bcb5")
(fg-region "#000000")
(bg-mode-line-active "#cab9b2")
(fg-mode-line-active "#000000")
(border-mode-line-active "#545454")
(bg-mode-line-inactive "#dfd9cf")
(fg-mode-line-inactive "#585858")
(border-mode-line-inactive "#a59a94")
(modeline-err "#7f0000")
(modeline-warning "#5f0070")
(modeline-info "#002580")
(bg-tab-bar "#e0d4ce")
(bg-tab-current "#fbf7f0")
(bg-tab-other "#c8b8b2")
;;; Diffs
(bg-added "#c3ebc1")
(bg-added-faint "#dcf8d1")
(bg-added-refine "#acd6a5")
(bg-added-fringe "#6cc06c")
(fg-added "#005000")
(fg-added-intense "#006700")
(bg-changed "#ffdfa9")
(bg-changed-faint "#ffefbf")
(bg-changed-refine "#fac090")
(bg-changed-fringe "#c0b200")
(fg-changed "#553d00")
(fg-changed-intense "#655000")
(bg-removed "#f4d0cf")
(bg-removed-faint "#ffe9e5")
(bg-removed-refine "#f3b5a7")
(bg-removed-fringe "#d84a4f")
(fg-removed "#8f1313")
(fg-removed-intense "#aa2222")
(bg-diff-context "#efe9df")
;;; Paren match
(bg-paren-match "#7fdfcf")
(fg-paren-match fg-main)
(bg-paren-expression "#efd3f5")
(underline-paren-match unspecified)
;;; Mappings
;;;; General mappings
(fringe bg-dim)
(cursor red-intense)
(keybind red)
(name magenta)
(identifier yellow-faint)
(err red)
(warning yellow)
(info green)
(underline-err red-intense)
(underline-warning yellow-intense)
(underline-note cyan-intense)
(bg-prominent-err bg-red-intense)
(fg-prominent-err fg-main)
(bg-prominent-warning bg-yellow-intense)
(fg-prominent-warning fg-main)
(bg-prominent-note bg-cyan-intense)
(fg-prominent-note fg-main)
(bg-active-argument bg-yellow-nuanced)
(fg-active-argument yellow-warmer)
(bg-active-value bg-cyan-nuanced)
(fg-active-value cyan-warmer)
;;;; Code mappings
(bracket fg-main)
(builtin magenta)
(comment red-faint)
(constant magenta-cooler)
(delimiter fg-main)
(docmarkup magenta-faint)
(docstring cyan-faint)
(fnname yellow-cooler)
(keyword blue)
(number fg-main)
(operator fg-main)
(preprocessor yellow-warmer)
(property green-cooler)
(punctuation fg-main)
(rx-backslash magenta-warmer)
(rx-construct magenta-cooler)
(string cyan)
(type green-warmer)
(variable green-cooler)
;;;; Accent mappings
(accent-0 red-cooler)
(accent-1 cyan)
(accent-2 magenta-cooler)
(accent-3 yellow-warmer)
;;;; Button mappings
(fg-button-active fg-main)
(fg-button-inactive fg-dim)
(bg-button-active bg-active)
(bg-button-inactive bg-dim)
;;;; Completion mappings
(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 unspecified)
(bg-completion-match-1 unspecified)
(bg-completion-match-2 unspecified)
(bg-completion-match-3 unspecified)
;;;; Date mappings
(date-common cyan)
(date-deadline red-cooler)
(date-deadline-subtle red-faint)
(date-event fg-alt)
(date-holiday red)
(date-holiday-other blue)
(date-now fg-main)
(date-range fg-alt)
(date-scheduled yellow)
(date-scheduled-subtle yellow-faint)
(date-weekday cyan)
(date-weekend magenta)
;;;; Line number mappings
(fg-line-number-inactive fg-dim)
(fg-line-number-active fg-main)
(bg-line-number-inactive bg-dim)
(bg-line-number-active bg-active)
;;;; Link mappings
(fg-link blue-warmer)
(bg-link unspecified)
(underline-link blue-warmer)
(fg-link-symbolic cyan)
(bg-link-symbolic unspecified)
(underline-link-symbolic cyan)
(fg-link-visited magenta)
(bg-link-visited unspecified)
(underline-link-visited magenta)
;;;; Mail mappings
(mail-cite-0 cyan)
(mail-cite-1 yellow)
(mail-cite-2 green-warmer)
(mail-cite-3 red-cooler)
(mail-part green-cooler)
(mail-recipient blue-warmer)
(mail-subject magenta-warmer)
(mail-other magenta)
;;;; Mark mappings
(bg-mark-delete bg-red-subtle)
(fg-mark-delete red)
(bg-mark-select bg-cyan-subtle)
(fg-mark-select cyan)
(bg-mark-other bg-yellow-subtle)
(fg-mark-other yellow)
;;;; Prompt mappings
(fg-prompt green-cooler)
(bg-prompt unspecified)
;;;; Prose mappings
(bg-prose-block-delimiter bg-dim)
(fg-prose-block-delimiter fg-dim)
(bg-prose-block-contents bg-dim)
(bg-prose-code unspecified)
(fg-prose-code green-cooler)
(bg-prose-macro unspecified)
(fg-prose-macro blue-cooler)
(bg-prose-verbatim unspecified)
(fg-prose-verbatim yellow-warmer)
(prose-done green)
(prose-todo red)
(prose-metadata fg-dim)
(prose-metadata-value fg-alt)
(prose-table fg-alt)
(prose-table-formula magenta-warmer)
(prose-tag magenta-faint)
;;;; Rainbow mappings
(rainbow-0 fg-main)
(rainbow-1 magenta-intense)
(rainbow-2 cyan-intense)
(rainbow-3 red-warmer)
(rainbow-4 yellow-intense)
(rainbow-5 magenta-cooler)
(rainbow-6 green-intense)
(rainbow-7 blue-warmer)
(rainbow-8 magenta-warmer)
;;;; Search mappings
(bg-search-current bg-yellow-intense)
(bg-search-lazy bg-cyan-intense)
(bg-search-replace bg-red-intense)
(bg-search-rx-group-0 bg-blue-intense)
(bg-search-rx-group-1 bg-green-intense)
(bg-search-rx-group-2 bg-red-subtle)
(bg-search-rx-group-3 bg-magenta-subtle)
;;;; Space mappings
(bg-space unspecified)
(fg-space border)
(bg-space-err bg-red-intense)
;;;; Terminal mappings
(bg-term-black "#000000")
(fg-term-black "#000000")
(bg-term-black-bright "#595959")
(fg-term-black-bright "#595959")
(bg-term-red red)
(fg-term-red red)
(bg-term-red-bright red-warmer)
(fg-term-red-bright red-warmer)
(bg-term-green green)
(fg-term-green green)
(bg-term-green-bright green-cooler)
(fg-term-green-bright green-cooler)
(bg-term-yellow yellow)
(fg-term-yellow yellow)
(bg-term-yellow-bright yellow-warmer)
(fg-term-yellow-bright yellow-warmer)
(bg-term-blue blue)
(fg-term-blue blue)
(bg-term-blue-bright blue-warmer)
(fg-term-blue-bright blue-warmer)
(bg-term-magenta magenta)
(fg-term-magenta magenta)
(bg-term-magenta-bright magenta-cooler)
(fg-term-magenta-bright magenta-cooler)
(bg-term-cyan cyan)
(fg-term-cyan cyan)
(bg-term-cyan-bright cyan-cooler)
(fg-term-cyan-bright cyan-cooler)
(bg-term-white "#a6a6a6")
(fg-term-white "#a6a6a6")
(bg-term-white-bright "#ffffff")
(fg-term-white-bright "#ffffff")
;;;; Heading mappings
(fg-heading-0 green-cooler)
(fg-heading-1 fg-main)
(fg-heading-2 yellow-faint)
(fg-heading-3 fg-alt)
(fg-heading-4 magenta)
(fg-heading-5 green-faint)
(fg-heading-6 red-faint)
(fg-heading-7 cyan-warmer)
(fg-heading-8 fg-dim)
(bg-heading-0 unspecified)
(bg-heading-1 unspecified)
(bg-heading-2 unspecified)
(bg-heading-3 unspecified)
(bg-heading-4 unspecified)
(bg-heading-5 unspecified)
(bg-heading-6 unspecified)
(bg-heading-7 unspecified)
(bg-heading-8 unspecified)
(overline-heading-0 unspecified)
(overline-heading-1 unspecified)
(overline-heading-2 unspecified)
(overline-heading-3 unspecified)
(overline-heading-4 unspecified)
(overline-heading-5 unspecified)
(overline-heading-6 unspecified)
(overline-heading-7 unspecified)
(overline-heading-8 unspecified))
"The entire palette of the `modus-operandi-tinted' theme.
Named colors have the form (COLOR-NAME HEX-VALUE) with the former
as a symbol and the latter as a string.
Semantic color mappings have the form (MAPPING-NAME COLOR-NAME)
with both as symbols. The latter is a named color that already
exists in the palette and is associated with a HEX-VALUE.")
(defcustom modus-operandi-tinted-palette-user nil
"Like the `modus-operandi-tinted-palette' for user-defined entries.
(unless (and (fboundp 'require-theme)
load-file-name
(equal (file-name-directory load-file-name)
(expand-file-name "themes/" data-directory))
(require-theme 'modus-themes t))
(require 'modus-themes))
(defcustom modus-operandi-tinted-palette-user nil
"Like the `modus-operandi-tinted-palette' for user-defined entries.
This is meant to extend the palette with custom named colors and/or
semantic palette mappings. Those may then be used in combination with
palette overrides (also see `modus-themes-common-palette-overrides' and
`modus-operandi-tinted-palette-overrides')."
:group 'modus-themes
:package-version '(modus-themes . "4.5.0")
:type '(repeat (list symbol (choice symbol string)))
:set #'modus-themes--set-option
:initialize #'custom-initialize-default
:link '(info-link "(modus-themes) Option to extend the palette for use with overrides"))
:group 'modus-themes
:package-version '(modus-themes . "4.5.0")
:type '(repeat (list symbol (choice symbol string)))
:link '(info-link "(modus-themes) Option to extend the palette for use with overrides"))
(defcustom modus-operandi-tinted-palette-overrides nil
"Overrides for `modus-operandi-tinted-palette'.
(defcustom modus-operandi-tinted-palette-overrides nil
"Overrides for `modus-operandi-tinted-palette'.
Mirror the elements of the aforementioned palette, overriding
their value.
@ -521,18 +68,25 @@ mappings, such as to make the cursor red. Wherea theme-specific
overrides can also be used to change the value of a named color,
such as what hexadecimal RGB value the red-warmer symbol
represents."
:group 'modus-themes
:package-version '(modus-themes . "4.0.0")
:version "30.1"
:type '(repeat (list symbol (choice symbol string)))
:set #'modus-themes--set-option
:initialize #'custom-initialize-default
:link '(info-link "(modus-themes) Palette overrides"))
:group 'modus-themes
:package-version '(modus-themes . "4.0.0")
:version "30.1"
:type '(repeat (list symbol (choice symbol string)))
:link '(info-link "(modus-themes) Palette overrides"))
(modus-themes-theme modus-operandi-tinted
modus-operandi-tinted-palette
modus-operandi-tinted-palette-overrides)
(modus-themes-theme
'modus-operandi-tinted
'modus-themes
"Elegant, highly legible theme with a light ochre background.
Conforms with the highest legibility standard for color contrast
between background and foreground in any given piece of text,
which corresponds to a minimum contrast in relative luminance of
7:1 (WCAG AAA standard)."
'light
'modus-themes-operandi-tinted-palette
'modus-operandi-tinted-palette-user
'modus-operandi-tinted-palette-overrides)
(provide-theme 'modus-operandi-tinted))
(provide 'modus-operandi-tinted-theme)
;;; modus-operandi-tinted-theme.el ends here

View file

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

File diff suppressed because it is too large Load diff

View file

@ -1,9 +1,9 @@
;;; modus-vivendi-deuteranopia-theme.el --- Deuteranopia-optimized theme with a black background -*- lexical-binding:t -*-
;; Copyright (C) 2019-2025 Free Software Foundation, Inc.
;; Copyright (C) 2019-2026 Free Software Foundation, Inc.
;; Author: Protesilaos Stavrou <info@protesilaos.com>
;; Maintainer: Protesilaos Stavrou <info@protesilaos.com>
;; Author: Protesilaos <info@protesilaos.com>
;; Maintainer: Protesilaos <info@protesilaos.com>
;; URL: https://github.com/protesilaos/modus-themes
;; Keywords: faces, theme, accessibility
@ -26,490 +26,35 @@
;;
;; The Modus themes conform with the highest standard for
;; color-contrast accessibility between background and foreground
;; values (WCAG AAA). Please refer to the official Info manual for
;; further documentation (distributed with the themes, or available
;; at: <https://protesilaos.com/emacs/modus-themes>).
;; values (WCAG AAA). They are also highly customizable and can even
;; be used as the basis for other themes. Please refer to the official
;; Info manual for further documentation (distributed with the themes,
;; or available at: <https://protesilaos.com/emacs/modus-themes>).
;;; Code:
(eval-and-compile
(unless (and (fboundp 'require-theme)
load-file-name
(equal (file-name-directory load-file-name)
(expand-file-name "themes/" data-directory))
(require-theme 'modus-themes t))
(require 'modus-themes))
;;;###theme-autoload
(deftheme modus-vivendi-deuteranopia
"Deuteranopia-optimized theme with a black background.
This variant is optimized for users with red-green color
deficiency (deuteranopia). It conforms with the highest
legibility standard for color contrast between background and
foreground in any given piece of text, which corresponds to a
minimum contrast in relative luminance of 7:1 (WCAG AAA
standard)."
:background-mode 'dark
:kind 'color-scheme
:family 'modus)
(defconst modus-vivendi-deuteranopia-palette
'(
;;; Basic values
(bg-main "#000000")
(bg-dim "#1e1e1e")
(fg-main "#ffffff")
(fg-dim "#989898")
(fg-alt "#c6daff")
(bg-active "#535353")
(bg-inactive "#303030")
(border "#646464")
;;; Common accent foregrounds
(red "#ff5f59")
(red-warmer "#ff6b55")
(red-cooler "#ff7f86")
(red-faint "#ff9580")
(red-intense "#ff5f5f")
(green "#44bc44")
(green-warmer "#70b900")
(green-cooler "#00c06f")
(green-faint "#88ca9f")
(green-intense "#44df44")
(yellow "#cabf00")
(yellow-warmer "#ffa00f")
(yellow-cooler "#d8af7a")
(yellow-faint "#d2b580")
(yellow-intense "#efef00")
(blue "#2fafff")
(blue-warmer "#79a8ff")
(blue-cooler "#00bcff")
(blue-faint "#82b0ec")
(blue-intense "#338fff")
(magenta "#feacd0")
(magenta-warmer "#f78fe7")
(magenta-cooler "#b6a0ff")
(magenta-faint "#caa6df")
(magenta-intense "#ff66ff")
(cyan "#00d3d0")
(cyan-warmer "#4ae2f0")
(cyan-cooler "#6ae4b9")
(cyan-faint "#9ac8e0")
(cyan-intense "#00eff0")
;;; Uncommon accent foregrounds
(rust "#db7b5f")
(gold "#c0965b")
(olive "#9cbd6f")
(slate "#76afbf")
(indigo "#9099d9")
(maroon "#cf7fa7")
(pink "#d09dc0")
;;; Common accent backgrounds
(bg-red-intense "#9d1f1f")
(bg-green-intense "#2f822f")
(bg-yellow-intense "#7a6100")
(bg-blue-intense "#1640b0")
(bg-magenta-intense "#7030af")
(bg-cyan-intense "#2266ae")
(bg-red-subtle "#620f2a")
(bg-green-subtle "#00422a")
(bg-yellow-subtle "#4a4000")
(bg-blue-subtle "#242679")
(bg-magenta-subtle "#552f5f")
(bg-cyan-subtle "#004065")
(bg-red-nuanced "#3a0c14")
(bg-green-nuanced "#092f1f")
(bg-yellow-nuanced "#381d0f")
(bg-blue-nuanced "#12154a")
(bg-magenta-nuanced "#2f0c3f")
(bg-cyan-nuanced "#042837")
;;; Uncommon accent background and foreground pairs
(bg-clay "#49191a")
(fg-clay "#f1b090")
(bg-ochre "#462f20")
(fg-ochre "#e0d09c")
(bg-lavender "#38325c")
(fg-lavender "#dfc0f0")
(bg-sage "#143e32")
(fg-sage "#c3e7d4")
;;; Graphs
(bg-graph-red-0 "#bf6000")
(bg-graph-red-1 "#733500")
(bg-graph-green-0 "#6fbf8f")
(bg-graph-green-1 "#2f5f4f")
(bg-graph-yellow-0 "#c1c00a")
(bg-graph-yellow-1 "#7f6640")
(bg-graph-blue-0 "#0f90ef")
(bg-graph-blue-1 "#1f2f8f")
(bg-graph-magenta-0 "#7f7f8e")
(bg-graph-magenta-1 "#4f4f5f")
(bg-graph-cyan-0 "#376f9a")
(bg-graph-cyan-1 "#00404f")
;;; Special purpose
(bg-completion "#2f447f")
(bg-hover "#45605e")
(bg-hover-secondary "#604c30")
(bg-hl-line "#2f3849")
(bg-region "#5a5a5a")
(fg-region "#ffffff")
(bg-mode-line-active "#2a2a6a")
(fg-mode-line-active "#f0f0f0")
(border-mode-line-active "#8080a7")
(bg-mode-line-inactive "#2d2d2d")
(fg-mode-line-inactive "#969696")
(border-mode-line-inactive "#606060")
(modeline-err "#e5bf00")
(modeline-warning "#c0cf35")
(modeline-info "#abeadf")
(bg-tab-bar "#313131")
(bg-tab-current "#000000")
(bg-tab-other "#545454")
;;; Diffs
(bg-added "#003066")
(bg-added-faint "#001a4f")
(bg-added-refine "#0f4a77")
(bg-added-fringe "#006fff")
(fg-added "#c4d5ff")
(fg-added-intense "#8080ff")
(bg-changed "#2f123f")
(bg-changed-faint "#1f022f")
(bg-changed-refine "#3f325f")
(bg-changed-fringe "#7f55a0")
(fg-changed "#e3cfff")
(fg-changed-intense "#cf9fe2")
(bg-removed "#3d3d00")
(bg-removed-faint "#281f00")
(bg-removed-refine "#555500")
(bg-removed-fringe "#d0c03f")
(fg-removed "#d4d48f")
(fg-removed-intense "#d0b05f")
(bg-diff-context "#1a1a1a")
;;; Paren match
(bg-paren-match "#2f7f9f")
(fg-paren-match fg-main)
(bg-paren-expression "#453040")
(underline-paren-match unspecified)
;;; Mappings
;;;; General mappings
(fringe bg-dim)
(cursor yellow-intense)
(keybind blue-cooler)
(name blue-cooler)
(identifier yellow-faint)
(err yellow-warmer)
(warning yellow)
(info blue)
(underline-err yellow-intense)
(underline-warning magenta-faint)
(underline-note cyan)
(bg-prominent-err bg-yellow-intense)
(fg-prominent-err fg-main)
(bg-prominent-warning bg-magenta-intense)
(fg-prominent-warning fg-main)
(bg-prominent-note bg-cyan-intense)
(fg-prominent-note fg-main)
(bg-active-argument bg-yellow-nuanced)
(fg-active-argument yellow-warmer)
(bg-active-value bg-blue-nuanced)
(fg-active-value blue-warmer)
;;;; Code mappings
(bracket fg-main)
(builtin yellow)
(comment yellow-cooler)
(constant blue-faint)
(delimiter fg-main)
(docmarkup magenta-faint)
(docstring cyan-faint)
(fnname yellow-warmer)
(keyword blue-cooler)
(number fg-main)
(operator fg-main)
(preprocessor magenta-cooler)
(property cyan)
(punctuation fg-main)
(rx-backslash blue-cooler)
(rx-construct yellow-cooler)
(string blue-warmer)
(type cyan-cooler)
(variable cyan)
;;;; Accent mappings
(accent-0 blue-warmer)
(accent-1 yellow)
(accent-2 cyan-cooler)
(accent-3 yellow-cooler)
;;;; Button mappings
(fg-button-active fg-main)
(fg-button-inactive fg-dim)
(bg-button-active bg-active)
(bg-button-inactive bg-dim)
;;;; Completion mappings
(fg-completion-match-0 blue-cooler)
(fg-completion-match-1 yellow)
(fg-completion-match-2 cyan-cooler)
(fg-completion-match-3 yellow-cooler)
(bg-completion-match-0 unspecified)
(bg-completion-match-1 unspecified)
(bg-completion-match-2 unspecified)
(bg-completion-match-3 unspecified)
;;;; Date mappings
(date-common cyan)
(date-deadline yellow-warmer)
(date-deadline-subtle red-faint)
(date-event fg-alt)
(date-holiday yellow-warmer)
(date-holiday-other blue)
(date-now fg-main)
(date-range fg-alt)
(date-scheduled yellow-cooler)
(date-scheduled-subtle yellow-faint)
(date-weekday cyan)
(date-weekend magenta-cooler)
;;;; Line number mappings
(fg-line-number-inactive fg-dim)
(fg-line-number-active fg-main)
(bg-line-number-inactive bg-dim)
(bg-line-number-active bg-active)
;;;; Link mappings
(fg-link blue-warmer)
(bg-link unspecified)
(underline-link blue-warmer)
(fg-link-symbolic cyan)
(bg-link-symbolic unspecified)
(underline-link-symbolic cyan)
(fg-link-visited yellow-faint)
(bg-link-visited unspecified)
(underline-link-visited yellow-faint)
;;;; Mail mappings
(mail-cite-0 blue-warmer)
(mail-cite-1 yellow-cooler)
(mail-cite-2 cyan-faint)
(mail-cite-3 yellow)
(mail-part blue)
(mail-recipient blue)
(mail-subject yellow-warmer)
(mail-other cyan-faint)
;;;; Mark mappings
(bg-mark-delete bg-yellow-subtle)
(fg-mark-delete yellow)
(bg-mark-select bg-cyan-subtle)
(fg-mark-select cyan)
(bg-mark-other bg-magenta-subtle)
(fg-mark-other magenta-warmer)
;;;; Prompt mappings
(fg-prompt blue)
(bg-prompt unspecified)
;;;; Prose mappings
(bg-prose-block-delimiter bg-dim)
(fg-prose-block-delimiter fg-dim)
(bg-prose-block-contents bg-dim)
(bg-prose-code unspecified)
(fg-prose-code cyan-cooler)
(bg-prose-macro unspecified)
(fg-prose-macro magenta-cooler)
(bg-prose-verbatim unspecified)
(fg-prose-verbatim yellow)
(prose-done blue)
(prose-todo yellow-warmer)
(prose-metadata fg-dim)
(prose-metadata-value fg-alt)
(prose-table fg-alt)
(prose-table-formula yellow-warmer)
(prose-tag fg-alt)
;;;; Rainbow mappings
(rainbow-0 yellow-warmer)
(rainbow-1 blue)
(rainbow-2 yellow-cooler)
(rainbow-3 blue-warmer)
(rainbow-4 yellow)
(rainbow-5 cyan-warmer)
(rainbow-6 yellow-faint)
(rainbow-7 blue-faint)
(rainbow-8 magenta-faint)
;;;; Search mappings
(bg-search-current bg-yellow-intense)
(bg-search-lazy bg-blue-intense)
(bg-search-replace bg-yellow-intense)
(bg-search-rx-group-0 bg-cyan-intense)
(bg-search-rx-group-1 bg-magenta-intense)
(bg-search-rx-group-2 bg-blue-subtle)
(bg-search-rx-group-3 bg-yellow-subtle)
;;;; Space mappings
(bg-space unspecified)
(fg-space border)
(bg-space-err bg-yellow-intense)
;;;; Terminal mappings
(bg-term-black "#000000")
(fg-term-black "#000000")
(bg-term-black-bright "#595959")
(fg-term-black-bright "#595959")
(bg-term-red red)
(fg-term-red red)
(bg-term-red-bright red-warmer)
(fg-term-red-bright red-warmer)
(bg-term-green green)
(fg-term-green green)
(bg-term-green-bright green-cooler)
(fg-term-green-bright green-cooler)
(bg-term-yellow yellow)
(fg-term-yellow yellow)
(bg-term-yellow-bright yellow-warmer)
(fg-term-yellow-bright yellow-warmer)
(bg-term-blue blue)
(fg-term-blue blue)
(bg-term-blue-bright blue-warmer)
(fg-term-blue-bright blue-warmer)
(bg-term-magenta magenta)
(fg-term-magenta magenta)
(bg-term-magenta-bright magenta-cooler)
(fg-term-magenta-bright magenta-cooler)
(bg-term-cyan cyan)
(fg-term-cyan cyan)
(bg-term-cyan-bright cyan-cooler)
(fg-term-cyan-bright cyan-cooler)
(bg-term-white "#a6a6a6")
(fg-term-white "#a6a6a6")
(bg-term-white-bright "#ffffff")
(fg-term-white-bright "#ffffff")
;;;; Heading mappings
(fg-heading-0 cyan-cooler)
(fg-heading-1 fg-main)
(fg-heading-2 yellow-faint)
(fg-heading-3 blue-faint)
(fg-heading-4 green-faint)
(fg-heading-5 magenta-cooler)
(fg-heading-6 yellow-cooler)
(fg-heading-7 cyan)
(fg-heading-8 fg-dim)
(bg-heading-0 unspecified)
(bg-heading-1 unspecified)
(bg-heading-2 unspecified)
(bg-heading-3 unspecified)
(bg-heading-4 unspecified)
(bg-heading-5 unspecified)
(bg-heading-6 unspecified)
(bg-heading-7 unspecified)
(bg-heading-8 unspecified)
(overline-heading-0 unspecified)
(overline-heading-1 unspecified)
(overline-heading-2 unspecified)
(overline-heading-3 unspecified)
(overline-heading-4 unspecified)
(overline-heading-5 unspecified)
(overline-heading-6 unspecified)
(overline-heading-7 unspecified)
(overline-heading-8 unspecified))
"The entire palette of the `modus-vivendi-deuteranopia' theme.
Named colors have the form (COLOR-NAME HEX-VALUE) with the former
as a symbol and the latter as a string.
Semantic color mappings have the form (MAPPING-NAME COLOR-NAME)
with both as symbols. The latter is a named color that already
exists in the palette and is associated with a HEX-VALUE.")
(defcustom modus-vivendi-deuteranopia-palette-user nil
"Like the `modus-vivendi-deuteranopia-palette' for user-defined entries.
(unless (and (fboundp 'require-theme)
load-file-name
(equal (file-name-directory load-file-name)
(expand-file-name "themes/" data-directory))
(require-theme 'modus-themes t))
(require 'modus-themes))
(defcustom modus-vivendi-deuteranopia-palette-user nil
"Like the `modus-vivendi-deuteranopia-palette' for user-defined entries.
This is meant to extend the palette with custom named colors and/or
semantic palette mappings. Those may then be used in combination with
palette overrides (also see `modus-themes-common-palette-overrides' and
`modus-vivendi-deuteranopia-palette-overrides')."
:group 'modus-themes
:package-version '(modus-themes . "4.5.0")
:type '(repeat (list symbol (choice symbol string)))
:set #'modus-themes--set-option
:initialize #'custom-initialize-default
:link '(info-link "(modus-themes) Option to extend the palette for use with overrides"))
:group 'modus-themes
:package-version '(modus-themes . "4.5.0")
:type '(repeat (list symbol (choice symbol string)))
:link '(info-link "(modus-themes) Option to extend the palette for use with overrides"))
(defcustom modus-vivendi-deuteranopia-palette-overrides nil
"Overrides for `modus-vivendi-deuteranopia-palette'.
(defcustom modus-vivendi-deuteranopia-palette-overrides nil
"Overrides for `modus-vivendi-deuteranopia-palette'.
Mirror the elements of the aforementioned palette, overriding
their value.
@ -523,18 +68,28 @@ mappings, such as to make the cursor red. Wherea theme-specific
overrides can also be used to change the value of a named color,
such as what hexadecimal RGB value the red-warmer symbol
represents."
:group 'modus-themes
:package-version '(modus-themes . "4.0.0")
:version "30.1"
:type '(repeat (list symbol (choice symbol string)))
:set #'modus-themes--set-option
:initialize #'custom-initialize-default
:link '(info-link "(modus-themes) Palette overrides"))
:group 'modus-themes
:package-version '(modus-themes . "4.0.0")
:version "30.1"
:type '(repeat (list symbol (choice symbol string)))
:link '(info-link "(modus-themes) Palette overrides"))
(modus-themes-theme modus-vivendi-deuteranopia
modus-vivendi-deuteranopia-palette
modus-vivendi-deuteranopia-palette-overrides)
(modus-themes-theme
'modus-vivendi-deuteranopia
'modus-themes
"Deuteranopia-optimized theme with a black background.
This variant is optimized for users with red-green color
deficiency (deuteranopia). It conforms with the highest
legibility standard for color contrast between background and
foreground in any given piece of text, which corresponds to a
minimum contrast in relative luminance of 7:1 (WCAG AAA
standard)."
'dark
'modus-themes-vivendi-deuteranopia-palette
'modus-vivendi-deuteranopia-palette-user
'modus-vivendi-deuteranopia-palette-overrides
'modus-themes-faces-deuteranopia)
(provide-theme 'modus-vivendi-deuteranopia))
(provide 'modus-vivendi-deuteranopia-theme)
;;; modus-vivendi-deuteranopia-theme.el ends here

View file

@ -1,9 +1,9 @@
;;; modus-vivendi-theme.el --- Elegant, highly legible theme with a black background -*- lexical-binding:t -*-
;; Copyright (C) 2019-2025 Free Software Foundation, Inc.
;; Copyright (C) 2019-2026 Free Software Foundation, Inc.
;; Author: Protesilaos Stavrou <info@protesilaos.com>
;; Maintainer: Protesilaos Stavrou <info@protesilaos.com>
;; Author: Protesilaos <info@protesilaos.com>
;; Maintainer: Protesilaos <info@protesilaos.com>
;; URL: https://github.com/protesilaos/modus-themes
;; Keywords: faces, theme, accessibility
@ -26,488 +26,35 @@
;;
;; The Modus themes conform with the highest standard for
;; color-contrast accessibility between background and foreground
;; values (WCAG AAA). Please refer to the official Info manual for
;; further documentation (distributed with the themes, or available
;; at: <https://protesilaos.com/emacs/modus-themes>).
;; values (WCAG AAA). They are also highly customizable and can even
;; be used as the basis for other themes. Please refer to the official
;; Info manual for further documentation (distributed with the themes,
;; or available at: <https://protesilaos.com/emacs/modus-themes>).
;;; Code:
(eval-and-compile
(unless (and (fboundp 'require-theme)
load-file-name
(equal (file-name-directory load-file-name)
(expand-file-name "themes/" data-directory))
(require-theme 'modus-themes t))
(require 'modus-themes))
;;;###theme-autoload
(deftheme modus-vivendi
"Elegant, highly legible theme with a black background.
Conforms with the highest legibility standard for color contrast
between background and foreground in any given piece of text,
which corresponds to a minimum contrast in relative luminance of
7:1 (WCAG AAA standard)."
:background-mode 'dark
:kind 'color-scheme
:family 'modus)
(defconst modus-vivendi-palette
'(
;;; Basic values
(bg-main "#000000")
(bg-dim "#1e1e1e")
(fg-main "#ffffff")
(fg-dim "#989898")
(fg-alt "#c6daff")
(bg-active "#535353")
(bg-inactive "#303030")
(border "#646464")
;;; Common accent foregrounds
(red "#ff5f59")
(red-warmer "#ff6b55")
(red-cooler "#ff7f86")
(red-faint "#ff9580")
(red-intense "#ff5f5f")
(green "#44bc44")
(green-warmer "#70b900")
(green-cooler "#00c06f")
(green-faint "#88ca9f")
(green-intense "#44df44")
(yellow "#d0bc00")
(yellow-warmer "#fec43f")
(yellow-cooler "#dfaf7a")
(yellow-faint "#d2b580")
(yellow-intense "#efef00")
(blue "#2fafff")
(blue-warmer "#79a8ff")
(blue-cooler "#00bcff")
(blue-faint "#82b0ec")
(blue-intense "#338fff")
(magenta "#feacd0")
(magenta-warmer "#f78fe7")
(magenta-cooler "#b6a0ff")
(magenta-faint "#caa6df")
(magenta-intense "#ff66ff")
(cyan "#00d3d0")
(cyan-warmer "#4ae2f0")
(cyan-cooler "#6ae4b9")
(cyan-faint "#9ac8e0")
(cyan-intense "#00eff0")
;;; Uncommon accent foregrounds
(rust "#db7b5f")
(gold "#c0965b")
(olive "#9cbd6f")
(slate "#76afbf")
(indigo "#9099d9")
(maroon "#cf7fa7")
(pink "#d09dc0")
;;; Common accent backgrounds
(bg-red-intense "#9d1f1f")
(bg-green-intense "#2f822f")
(bg-yellow-intense "#7a6100")
(bg-blue-intense "#1640b0")
(bg-magenta-intense "#7030af")
(bg-cyan-intense "#2266ae")
(bg-red-subtle "#620f2a")
(bg-green-subtle "#00422a")
(bg-yellow-subtle "#4a4000")
(bg-blue-subtle "#242679")
(bg-magenta-subtle "#552f5f")
(bg-cyan-subtle "#004065")
(bg-red-nuanced "#3a0c14")
(bg-green-nuanced "#092f1f")
(bg-yellow-nuanced "#381d0f")
(bg-blue-nuanced "#12154a")
(bg-magenta-nuanced "#2f0c3f")
(bg-cyan-nuanced "#042837")
;;; Uncommon accent background and foreground pairs
(bg-clay "#49191a")
(fg-clay "#f1b090")
(bg-ochre "#462f20")
(fg-ochre "#e0d09c")
(bg-lavender "#38325c")
(fg-lavender "#dfc0f0")
(bg-sage "#143e32")
(fg-sage "#c3e7d4")
;;; Graphs
(bg-graph-red-0 "#b52c2c")
(bg-graph-red-1 "#702020")
(bg-graph-green-0 "#0fed00")
(bg-graph-green-1 "#007800")
(bg-graph-yellow-0 "#f1e00a")
(bg-graph-yellow-1 "#b08940")
(bg-graph-blue-0 "#2fafef")
(bg-graph-blue-1 "#1f2f8f")
(bg-graph-magenta-0 "#bf94fe")
(bg-graph-magenta-1 "#5f509f")
(bg-graph-cyan-0 "#47dfea")
(bg-graph-cyan-1 "#00808f")
;;; Special purpose
(bg-completion "#2f447f")
(bg-hover "#45605e")
(bg-hover-secondary "#654a39")
(bg-hl-line "#2f3849")
(bg-region "#5a5a5a")
(fg-region "#ffffff")
(bg-mode-line-active "#505050")
(fg-mode-line-active "#ffffff")
(border-mode-line-active "#959595")
(bg-mode-line-inactive "#2d2d2d")
(fg-mode-line-inactive "#969696")
(border-mode-line-inactive "#606060")
(modeline-err "#ffa9bf")
(modeline-warning "#dfcf43")
(modeline-info "#9fefff")
(bg-tab-bar "#313131")
(bg-tab-current "#000000")
(bg-tab-other "#545454")
;;; Diffs
(bg-added "#00381f")
(bg-added-faint "#002910")
(bg-added-refine "#034f2f")
(bg-added-fringe "#237f3f")
(fg-added "#a0e0a0")
(fg-added-intense "#80e080")
(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")
(bg-diff-context "#1a1a1a")
;;; Paren match
(bg-paren-match "#2f7f9f")
(fg-paren-match fg-main)
(bg-paren-expression "#453040")
(underline-paren-match unspecified)
;;; Mappings
;;;; General mappings
(fringe bg-dim)
(cursor fg-main)
(keybind blue-cooler)
(name magenta)
(identifier yellow-faint)
(err red)
(warning yellow-warmer)
(info cyan-cooler)
(underline-err red-intense)
(underline-warning yellow)
(underline-note cyan)
(bg-prominent-err bg-red-intense)
(fg-prominent-err fg-main)
(bg-prominent-warning bg-yellow-intense)
(fg-prominent-warning fg-main)
(bg-prominent-note bg-cyan-intense)
(fg-prominent-note fg-main)
(bg-active-argument bg-yellow-nuanced)
(fg-active-argument yellow-cooler)
(bg-active-value bg-cyan-nuanced)
(fg-active-value cyan-cooler)
;;;; Code mappings
(bracket fg-main)
(builtin magenta-warmer)
(comment fg-dim)
(constant blue-cooler)
(delimiter fg-main)
(docmarkup magenta-faint)
(docstring cyan-faint)
(fnname magenta)
(keyword magenta-cooler)
(number fg-main)
(operator fg-main)
(preprocessor red-cooler)
(property cyan)
(punctuation fg-main)
(rx-backslash magenta)
(rx-construct green-cooler)
(string blue-warmer)
(type cyan-cooler)
(variable cyan)
;;;; Accent mappings
(accent-0 blue-cooler)
(accent-1 magenta-warmer)
(accent-2 cyan-cooler)
(accent-3 yellow)
;;;; Button mappings
(fg-button-active fg-main)
(fg-button-inactive fg-dim)
(bg-button-active bg-active)
(bg-button-inactive bg-dim)
;;;; Completion mappings
(fg-completion-match-0 blue-cooler)
(fg-completion-match-1 magenta-warmer)
(fg-completion-match-2 cyan-cooler)
(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)
;;;; Date mappings
(date-common cyan)
(date-deadline red-cooler)
(date-deadline-subtle red-faint)
(date-event fg-alt)
(date-holiday magenta-warmer)
(date-holiday-other blue)
(date-now fg-main)
(date-range fg-alt)
(date-scheduled yellow-cooler)
(date-scheduled-subtle yellow-faint)
(date-weekday cyan)
(date-weekend magenta)
;;;; Line number mappings
(fg-line-number-inactive fg-dim)
(fg-line-number-active fg-main)
(bg-line-number-inactive bg-dim)
(bg-line-number-active bg-active)
;;;; Link mappings
(fg-link blue-warmer)
(bg-link unspecified)
(underline-link blue-warmer)
(fg-link-symbolic cyan)
(bg-link-symbolic unspecified)
(underline-link-symbolic cyan)
(fg-link-visited magenta)
(bg-link-visited unspecified)
(underline-link-visited magenta)
;;;; Mail mappings
(mail-cite-0 blue-warmer)
(mail-cite-1 yellow-cooler)
(mail-cite-2 cyan-cooler)
(mail-cite-3 red-cooler)
(mail-part blue)
(mail-recipient magenta-cooler)
(mail-subject magenta-warmer)
(mail-other magenta-faint)
;;;; Mark mappings
(bg-mark-delete bg-red-subtle)
(fg-mark-delete red-cooler)
(bg-mark-select bg-cyan-subtle)
(fg-mark-select cyan)
(bg-mark-other bg-yellow-subtle)
(fg-mark-other yellow)
;;;; Prompt mappings
(fg-prompt cyan-cooler)
(bg-prompt unspecified)
;;;; Prose mappings
(bg-prose-block-delimiter bg-dim)
(fg-prose-block-delimiter fg-dim)
(bg-prose-block-contents bg-dim)
(bg-prose-code unspecified)
(fg-prose-code cyan-cooler)
(bg-prose-macro unspecified)
(fg-prose-macro magenta-cooler)
(bg-prose-verbatim unspecified)
(fg-prose-verbatim magenta-warmer)
(prose-done green)
(prose-todo red)
(prose-metadata fg-dim)
(prose-metadata-value fg-alt)
(prose-table fg-alt)
(prose-table-formula magenta-warmer)
(prose-tag magenta-faint)
;;;; Rainbow mappings
(rainbow-0 fg-main)
(rainbow-1 magenta-intense)
(rainbow-2 cyan-intense)
(rainbow-3 red-warmer)
(rainbow-4 yellow-intense)
(rainbow-5 magenta-cooler)
(rainbow-6 green-intense)
(rainbow-7 blue-warmer)
(rainbow-8 magenta-warmer)
;;;; Search mappings
(bg-search-current bg-yellow-intense)
(bg-search-lazy bg-cyan-intense)
(bg-search-replace bg-red-intense)
(bg-search-rx-group-0 bg-blue-intense)
(bg-search-rx-group-1 bg-green-intense)
(bg-search-rx-group-2 bg-red-subtle)
(bg-search-rx-group-3 bg-magenta-subtle)
;;;; Space mappings
(bg-space unspecified)
(fg-space border)
(bg-space-err bg-red-intense)
;;;; Terminal mappings
(bg-term-black "#000000")
(fg-term-black "#000000")
(bg-term-black-bright "#595959")
(fg-term-black-bright "#595959")
(bg-term-red red)
(fg-term-red red)
(bg-term-red-bright red-warmer)
(fg-term-red-bright red-warmer)
(bg-term-green green)
(fg-term-green green)
(bg-term-green-bright green-cooler)
(fg-term-green-bright green-cooler)
(bg-term-yellow yellow)
(fg-term-yellow yellow)
(bg-term-yellow-bright yellow-warmer)
(fg-term-yellow-bright yellow-warmer)
(bg-term-blue blue)
(fg-term-blue blue)
(bg-term-blue-bright blue-warmer)
(fg-term-blue-bright blue-warmer)
(bg-term-magenta magenta)
(fg-term-magenta magenta)
(bg-term-magenta-bright magenta-cooler)
(fg-term-magenta-bright magenta-cooler)
(bg-term-cyan cyan)
(fg-term-cyan cyan)
(bg-term-cyan-bright cyan-cooler)
(fg-term-cyan-bright cyan-cooler)
(bg-term-white "#a6a6a6")
(fg-term-white "#a6a6a6")
(bg-term-white-bright "#ffffff")
(fg-term-white-bright "#ffffff")
;;;; Heading mappings
(fg-heading-0 cyan-cooler)
(fg-heading-1 fg-main)
(fg-heading-2 yellow-faint)
(fg-heading-3 blue-faint)
(fg-heading-4 magenta)
(fg-heading-5 green-faint)
(fg-heading-6 red-faint)
(fg-heading-7 cyan-faint)
(fg-heading-8 fg-dim)
(bg-heading-0 unspecified)
(bg-heading-1 unspecified)
(bg-heading-2 unspecified)
(bg-heading-3 unspecified)
(bg-heading-4 unspecified)
(bg-heading-5 unspecified)
(bg-heading-6 unspecified)
(bg-heading-7 unspecified)
(bg-heading-8 unspecified)
(overline-heading-0 unspecified)
(overline-heading-1 unspecified)
(overline-heading-2 unspecified)
(overline-heading-3 unspecified)
(overline-heading-4 unspecified)
(overline-heading-5 unspecified)
(overline-heading-6 unspecified)
(overline-heading-7 unspecified)
(overline-heading-8 unspecified))
"The entire palette of the `modus-vivendi' theme.
Named colors have the form (COLOR-NAME HEX-VALUE) with the former
as a symbol and the latter as a string.
Semantic color mappings have the form (MAPPING-NAME COLOR-NAME)
with both as symbols. The latter is a named color that already
exists in the palette and is associated with a HEX-VALUE.")
(defcustom modus-vivendi-palette-user nil
"Like the `modus-vivendi--palette' for user-defined entries.
(unless (and (fboundp 'require-theme)
load-file-name
(equal (file-name-directory load-file-name)
(expand-file-name "themes/" data-directory))
(require-theme 'modus-themes t))
(require 'modus-themes))
(defcustom modus-vivendi-palette-user nil
"Like the `modus-vivendi--palette' for user-defined entries.
This is meant to extend the palette with custom named colors and/or
semantic palette mappings. Those may then be used in combination with
palette overrides (also see `modus-themes-common-palette-overrides' and
`modus-vivendi--palette-overrides')."
:group 'modus-themes
:package-version '(modus-themes . "4.5.0")
:type '(repeat (list symbol (choice symbol string)))
:set #'modus-themes--set-option
:initialize #'custom-initialize-default
:link '(info-link "(modus-themes) Option to extend the palette for use with overrides"))
:group 'modus-themes
:package-version '(modus-themes . "4.5.0")
:type '(repeat (list symbol (choice symbol string)))
:link '(info-link "(modus-themes) Option to extend the palette for use with overrides"))
(defcustom modus-vivendi-palette-overrides nil
"Overrides for `modus-vivendi-palette'.
(defcustom modus-vivendi-palette-overrides nil
"Overrides for `modus-vivendi-palette'.
Mirror the elements of the aforementioned palette, overriding
their value.
@ -521,18 +68,25 @@ mappings, such as to make the cursor red. Wherea theme-specific
overrides can also be used to change the value of a named color,
such as what hexadecimal RGB value the red-warmer symbol
represents."
:group 'modus-themes
:package-version '(modus-themes . "4.0.0")
:version "30.1"
:type '(repeat (list symbol (choice symbol string)))
:set #'modus-themes--set-option
:initialize #'custom-initialize-default
:link '(info-link "(modus-themes) Palette overrides"))
:group 'modus-themes
:package-version '(modus-themes . "4.0.0")
:version "30.1"
:type '(repeat (list symbol (choice symbol string)))
:link '(info-link "(modus-themes) Palette overrides"))
(modus-themes-theme modus-vivendi
modus-vivendi-palette
modus-vivendi-palette-overrides)
(modus-themes-theme
'modus-vivendi
'modus-themes
"Elegant, highly legible theme with a black background.
Conforms with the highest legibility standard for color contrast
between background and foreground in any given piece of text,
which corresponds to a minimum contrast in relative luminance of
7:1 (WCAG AAA standard)."
'dark
'modus-themes-vivendi-palette
'modus-vivendi-palette-user
'modus-vivendi-palette-overrides)
(provide-theme 'modus-vivendi))
(provide 'modus-vivendi-theme)
;;; modus-vivendi-theme.el ends here

View file

@ -1,9 +1,9 @@
;;; modus-vivendi-tinted-theme.el --- Elegant, highly legible theme with a night sky background -*- lexical-binding:t -*-
;; Copyright (C) 2019-2025 Free Software Foundation, Inc.
;; Copyright (C) 2019-2026 Free Software Foundation, Inc.
;; Author: Protesilaos Stavrou <info@protesilaos.com>
;; Maintainer: Protesilaos Stavrou <info@protesilaos.com>
;; Author: Protesilaos <info@protesilaos.com>
;; Maintainer: Protesilaos <info@protesilaos.com>
;; URL: https://github.com/protesilaos/modus-themes
;; Keywords: faces, theme, accessibility
@ -26,488 +26,35 @@
;;
;; The Modus themes conform with the highest standard for
;; color-contrast accessibility between background and foreground
;; values (WCAG AAA). Please refer to the official Info manual for
;; further documentation (distributed with the themes, or available
;; at: <https://protesilaos.com/emacs/modus-themes>).
;; values (WCAG AAA). They are also highly customizable and can even
;; be used as the basis for other themes. Please refer to the official
;; Info manual for further documentation (distributed with the themes,
;; or available at: <https://protesilaos.com/emacs/modus-themes>).
;;; Code:
(eval-and-compile
(unless (and (fboundp 'require-theme)
load-file-name
(equal (file-name-directory load-file-name)
(expand-file-name "themes/" data-directory))
(require-theme 'modus-themes t))
(require 'modus-themes))
;;;###theme-autoload
(deftheme modus-vivendi-tinted
"Elegant, highly legible theme with a night sky background.
Conforms with the highest legibility standard for color contrast
between background and foreground in any given piece of text,
which corresponds to a minimum contrast in relative luminance of
7:1 (WCAG AAA standard)."
:background-mode 'dark
:kind 'color-scheme
:family 'modus)
(defconst modus-vivendi-tinted-palette
'(
;;; Basic values
(bg-main "#0d0e1c")
(bg-dim "#1d2235")
(fg-main "#ffffff")
(fg-dim "#989898")
(fg-alt "#c6daff")
(bg-active "#4a4f69")
(bg-inactive "#2b3045")
(border "#61647a")
;;; Common accent foregrounds
(red "#ff5f59")
(red-warmer "#ff6b55")
(red-cooler "#ff7f86")
(red-faint "#ef8386")
(red-intense "#ff5f5f")
(green "#44bc44")
(green-warmer "#75c13e")
(green-cooler "#11c777")
(green-faint "#88ca9f")
(green-intense "#44df44")
(yellow "#d0bc00")
(yellow-warmer "#fec43f")
(yellow-cooler "#dfaf7a")
(yellow-faint "#d2b580")
(yellow-intense "#efef00")
(blue "#2fafff")
(blue-warmer "#79a8ff")
(blue-cooler "#00bcff")
(blue-faint "#82b0ec")
(blue-intense "#338fff")
(magenta "#feacd0")
(magenta-warmer "#f78fe7")
(magenta-cooler "#b6a0ff")
(magenta-faint "#caa6df")
(magenta-intense "#ff66ff")
(cyan "#00d3d0")
(cyan-warmer "#4ae2f0")
(cyan-cooler "#6ae4b9")
(cyan-faint "#9ac8e0")
(cyan-intense "#00eff0")
;;; Uncommon accent foregrounds
(rust "#db7b5f")
(gold "#c0965b")
(olive "#9cbd6f")
(slate "#76afbf")
(indigo "#9099d9")
(maroon "#cf7fa7")
(pink "#d09dc0")
;;; Common accent backgrounds
(bg-red-intense "#9d1f1f")
(bg-green-intense "#2f822f")
(bg-yellow-intense "#7a6100")
(bg-blue-intense "#1640b0")
(bg-magenta-intense "#7030af")
(bg-cyan-intense "#2266ae")
(bg-red-subtle "#620f2a")
(bg-green-subtle "#00422a")
(bg-yellow-subtle "#4a4000")
(bg-blue-subtle "#242679")
(bg-magenta-subtle "#552f5f")
(bg-cyan-subtle "#004065")
(bg-red-nuanced "#3a0c14")
(bg-green-nuanced "#092f1f")
(bg-yellow-nuanced "#381d0f")
(bg-blue-nuanced "#12154a")
(bg-magenta-nuanced "#2f0c3f")
(bg-cyan-nuanced "#042837")
;;; Uncommon accent background and foreground pairs
(bg-clay "#49191a")
(fg-clay "#f1b090")
(bg-ochre "#462f20")
(fg-ochre "#e0d09c")
(bg-lavender "#38325c")
(fg-lavender "#dfc0f0")
(bg-sage "#143e32")
(fg-sage "#c3e7d4")
;;; Graphs
(bg-graph-red-0 "#b52c2c")
(bg-graph-red-1 "#702020")
(bg-graph-green-0 "#0fed00")
(bg-graph-green-1 "#007800")
(bg-graph-yellow-0 "#f1e00a")
(bg-graph-yellow-1 "#b08940")
(bg-graph-blue-0 "#2fafef")
(bg-graph-blue-1 "#1f2f8f")
(bg-graph-magenta-0 "#bf94fe")
(bg-graph-magenta-1 "#5f509f")
(bg-graph-cyan-0 "#47dfea")
(bg-graph-cyan-1 "#00808f")
;;; Special purpose
(bg-completion "#483d8a")
(bg-hover "#45605e")
(bg-hover-secondary "#64404f")
(bg-hl-line "#303a6f")
(bg-region "#555a66")
(fg-region "#ffffff")
(bg-mode-line-active "#484d67")
(fg-mode-line-active "#ffffff")
(border-mode-line-active "#979797")
(bg-mode-line-inactive "#292d48")
(fg-mode-line-inactive "#969696")
(border-mode-line-inactive "#606270")
(modeline-err "#ffa9bf")
(modeline-warning "#dfcf43")
(modeline-info "#9fefff")
(bg-tab-bar "#2c3045")
(bg-tab-current "#0d0e1c")
(bg-tab-other "#4a4f6a")
;;; Diffs
(bg-added "#003a2f")
(bg-added-faint "#002922")
(bg-added-refine "#035542")
(bg-added-fringe "#23884f")
(fg-added "#a0e0a0")
(fg-added-intense "#80e080")
(bg-changed "#363300")
(bg-changed-faint "#2a1f00")
(bg-changed-refine "#4a4a00")
(bg-changed-fringe "#8f7a30")
(fg-changed "#efef80")
(fg-changed-intense "#c0b05f")
(bg-removed "#4f1127")
(bg-removed-faint "#380a19")
(bg-removed-refine "#781a3a")
(bg-removed-fringe "#b81a26")
(fg-removed "#ffbfbf")
(fg-removed-intense "#ff9095")
(bg-diff-context "#1a1f30")
;;; Paren match
(bg-paren-match "#4f7f9f")
(fg-paren-match fg-main)
(bg-paren-expression "#453040")
(underline-paren-match unspecified)
;;; Mappings
;;;; General mappings
(fringe bg-dim)
(cursor magenta-intense)
(keybind magenta-cooler)
(name magenta)
(identifier yellow-faint)
(err red)
(warning yellow)
(info green-cooler)
(underline-err red-intense)
(underline-warning yellow)
(underline-note cyan)
(bg-prominent-err bg-red-intense)
(fg-prominent-err fg-main)
(bg-prominent-warning bg-yellow-intense)
(fg-prominent-warning fg-main)
(bg-prominent-note bg-cyan-intense)
(fg-prominent-note fg-main)
(bg-active-argument bg-yellow-nuanced)
(fg-active-argument yellow-cooler)
(bg-active-value bg-cyan-nuanced)
(fg-active-value cyan-cooler)
;;;; Code mappings
(bracket fg-main)
(builtin magenta)
(comment red-faint)
(constant magenta-cooler)
(delimiter fg-main)
(docmarkup magenta-faint)
(docstring cyan-faint)
(fnname magenta-warmer)
(keyword blue-warmer)
(number fg-main)
(operator fg-main)
(preprocessor red-cooler)
(property cyan-warmer)
(punctuation fg-main)
(rx-backslash magenta-warmer)
(rx-construct magenta-cooler)
(string blue)
(type green-cooler)
(variable cyan-warmer)
;;;; Accent mappings
(accent-0 magenta-cooler)
(accent-1 cyan)
(accent-2 magenta-warmer)
(accent-3 yellow-warmer)
;;;; Button mappings
(fg-button-active fg-main)
(fg-button-inactive fg-dim)
(bg-button-active bg-active)
(bg-button-inactive bg-dim)
;;;; Completion mappings
(fg-completion-match-0 blue-cooler)
(fg-completion-match-1 magenta-warmer)
(fg-completion-match-2 cyan-cooler)
(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)
;;;; Date mappings
(date-common cyan)
(date-deadline red-cooler)
(date-deadline-subtle red-faint)
(date-event fg-alt)
(date-holiday magenta-warmer)
(date-holiday-other blue)
(date-now fg-main)
(date-range fg-alt)
(date-scheduled yellow-cooler)
(date-scheduled-subtle yellow-faint)
(date-weekday cyan)
(date-weekend magenta)
;;;; Line number mappings
(fg-line-number-inactive fg-dim)
(fg-line-number-active fg-main)
(bg-line-number-inactive bg-dim)
(bg-line-number-active bg-active)
;;;; Link mappings
(fg-link blue-warmer)
(bg-link unspecified)
(underline-link blue-warmer)
(fg-link-symbolic cyan)
(bg-link-symbolic unspecified)
(underline-link-symbolic cyan)
(fg-link-visited magenta)
(bg-link-visited unspecified)
(underline-link-visited magenta)
;;;; Mail mappings
(mail-cite-0 blue-faint)
(mail-cite-1 yellow-cooler)
(mail-cite-2 cyan-cooler)
(mail-cite-3 red-cooler)
(mail-part blue)
(mail-recipient blue-warmer)
(mail-subject magenta-warmer)
(mail-other magenta)
;;;; Mark mappings
(bg-mark-delete bg-red-subtle)
(fg-mark-delete red-cooler)
(bg-mark-select bg-cyan-subtle)
(fg-mark-select cyan)
(bg-mark-other bg-yellow-subtle)
(fg-mark-other yellow)
;;;; Prompt mappings
(fg-prompt cyan-warmer)
(bg-prompt unspecified)
;;;; Prose mappings
(bg-prose-block-delimiter bg-dim)
(fg-prose-block-delimiter fg-dim)
(bg-prose-block-contents bg-dim)
(bg-prose-code unspecified)
(fg-prose-code cyan-cooler)
(bg-prose-macro unspecified)
(fg-prose-macro magenta-cooler)
(bg-prose-verbatim unspecified)
(fg-prose-verbatim magenta-warmer)
(prose-done green)
(prose-todo red)
(prose-metadata fg-dim)
(prose-metadata-value fg-alt)
(prose-table fg-alt)
(prose-table-formula magenta-warmer)
(prose-tag magenta-faint)
;;;; Rainbow mappings
(rainbow-0 fg-main)
(rainbow-1 magenta-intense)
(rainbow-2 cyan-intense)
(rainbow-3 red-warmer)
(rainbow-4 yellow-intense)
(rainbow-5 magenta-cooler)
(rainbow-6 green-intense)
(rainbow-7 blue-warmer)
(rainbow-8 magenta-warmer)
;;;; Search mappings
(bg-search-current bg-yellow-intense)
(bg-search-lazy bg-cyan-intense)
(bg-search-replace bg-red-intense)
(bg-search-rx-group-0 bg-blue-intense)
(bg-search-rx-group-1 bg-green-intense)
(bg-search-rx-group-2 bg-red-subtle)
(bg-search-rx-group-3 bg-magenta-subtle)
;;;; Space mappings
(bg-space unspecified)
(fg-space border)
(bg-space-err bg-red-intense)
;;;; Terminal mappings
(bg-term-black "#000000")
(fg-term-black "#000000")
(bg-term-black-bright "#595959")
(fg-term-black-bright "#595959")
(bg-term-red red)
(fg-term-red red)
(bg-term-red-bright red-warmer)
(fg-term-red-bright red-warmer)
(bg-term-green green)
(fg-term-green green)
(bg-term-green-bright green-cooler)
(fg-term-green-bright green-cooler)
(bg-term-yellow yellow)
(fg-term-yellow yellow)
(bg-term-yellow-bright yellow-warmer)
(fg-term-yellow-bright yellow-warmer)
(bg-term-blue blue)
(fg-term-blue blue)
(bg-term-blue-bright blue-warmer)
(fg-term-blue-bright blue-warmer)
(bg-term-magenta magenta)
(fg-term-magenta magenta)
(bg-term-magenta-bright magenta-cooler)
(fg-term-magenta-bright magenta-cooler)
(bg-term-cyan cyan)
(fg-term-cyan cyan)
(bg-term-cyan-bright cyan-cooler)
(fg-term-cyan-bright cyan-cooler)
(bg-term-white "#a6a6a6")
(fg-term-white "#a6a6a6")
(bg-term-white-bright "#ffffff")
(fg-term-white-bright "#ffffff")
;;;; Heading mappings
(fg-heading-0 cyan-cooler)
(fg-heading-1 fg-main)
(fg-heading-2 yellow-faint)
(fg-heading-3 blue-faint)
(fg-heading-4 magenta)
(fg-heading-5 green-faint)
(fg-heading-6 red-faint)
(fg-heading-7 cyan-faint)
(fg-heading-8 fg-dim)
(bg-heading-0 unspecified)
(bg-heading-1 unspecified)
(bg-heading-2 unspecified)
(bg-heading-3 unspecified)
(bg-heading-4 unspecified)
(bg-heading-5 unspecified)
(bg-heading-6 unspecified)
(bg-heading-7 unspecified)
(bg-heading-8 unspecified)
(overline-heading-0 unspecified)
(overline-heading-1 unspecified)
(overline-heading-2 unspecified)
(overline-heading-3 unspecified)
(overline-heading-4 unspecified)
(overline-heading-5 unspecified)
(overline-heading-6 unspecified)
(overline-heading-7 unspecified)
(overline-heading-8 unspecified))
"The entire palette of the `modus-vivendi-tinted' theme.
Named colors have the form (COLOR-NAME HEX-VALUE) with the former
as a symbol and the latter as a string.
Semantic color mappings have the form (MAPPING-NAME COLOR-NAME)
with both as symbols. The latter is a named color that already
exists in the palette and is associated with a HEX-VALUE.")
(defcustom modus-vivendi-tinted-palette-user nil
"Like the `modus-vivendi-tinted-palette' for user-defined entries.
(unless (and (fboundp 'require-theme)
load-file-name
(equal (file-name-directory load-file-name)
(expand-file-name "themes/" data-directory))
(require-theme 'modus-themes t))
(require 'modus-themes))
(defcustom modus-vivendi-tinted-palette-user nil
"Like the `modus-vivendi-tinted-palette' for user-defined entries.
This is meant to extend the palette with custom named colors and/or
semantic palette mappings. Those may then be used in combination with
palette overrides (also see `modus-themes-common-palette-overrides' and
`modus-vivendi-tinted-palette-overrides')."
:group 'modus-themes
:package-version '(modus-themes . "4.5.0")
:type '(repeat (list symbol (choice symbol string)))
:set #'modus-themes--set-option
:initialize #'custom-initialize-default
:link '(info-link "(modus-themes) Option to extend the palette for use with overrides"))
:group 'modus-themes
:package-version '(modus-themes . "4.5.0")
:type '(repeat (list symbol (choice symbol string)))
:link '(info-link "(modus-themes) Option to extend the palette for use with overrides"))
(defcustom modus-vivendi-tinted-palette-overrides nil
"Overrides for `modus-vivendi-tinted-palette'.
(defcustom modus-vivendi-tinted-palette-overrides nil
"Overrides for `modus-vivendi-tinted-palette'.
Mirror the elements of the aforementioned palette, overriding
their value.
@ -521,18 +68,25 @@ mappings, such as to make the cursor red. Wherea theme-specific
overrides can also be used to change the value of a named color,
such as what hexadecimal RGB value the red-warmer symbol
represents."
:group 'modus-themes
:package-version '(modus-themes . "4.0.0")
:version "30.1"
:type '(repeat (list symbol (choice symbol string)))
:set #'modus-themes--set-option
:initialize #'custom-initialize-default
:link '(info-link "(modus-themes) Palette overrides"))
:group 'modus-themes
:package-version '(modus-themes . "4.0.0")
:version "30.1"
:type '(repeat (list symbol (choice symbol string)))
:link '(info-link "(modus-themes) Palette overrides"))
(modus-themes-theme modus-vivendi-tinted
modus-vivendi-tinted-palette
modus-vivendi-tinted-palette-overrides)
(modus-themes-theme
'modus-vivendi-tinted
'modus-themes
"Elegant, highly legible theme with a night sky background.
Conforms with the highest legibility standard for color contrast
between background and foreground in any given piece of text,
which corresponds to a minimum contrast in relative luminance of
7:1 (WCAG AAA standard)."
'dark
'modus-themes-vivendi-tinted-palette
'modus-vivendi-tinted-palette-user
'modus-vivendi-tinted-palette-overrides)
(provide-theme 'modus-vivendi-tinted))
(provide 'modus-vivendi-tinted-theme)
;;; modus-vivendi-tinted-theme.el ends here

View file

@ -1,9 +1,9 @@
;;; modus-vivendi-tritanopia-theme.el --- Tritanopia-optimized theme with a black background -*- lexical-binding:t -*-
;; Copyright (C) 2019-2025 Free Software Foundation, Inc.
;; Copyright (C) 2019-2026 Free Software Foundation, Inc.
;; Author: Protesilaos Stavrou <info@protesilaos.com>
;; Maintainer: Protesilaos Stavrou <info@protesilaos.com>
;; Author: Protesilaos <info@protesilaos.com>
;; Maintainer: Protesilaos <info@protesilaos.com>
;; URL: https://github.com/protesilaos/modus-themes
;; Keywords: faces, theme, accessibility
@ -26,490 +26,35 @@
;;
;; The Modus themes conform with the highest standard for
;; color-contrast accessibility between background and foreground
;; values (WCAG AAA). Please refer to the official Info manual for
;; further documentation (distributed with the themes, or available
;; at: <https://protesilaos.com/emacs/modus-themes>).
;; values (WCAG AAA). They are also highly customizable and can even
;; be used as the basis for other themes. Please refer to the official
;; Info manual for further documentation (distributed with the themes,
;; or available at: <https://protesilaos.com/emacs/modus-themes>).
;;; Code:
(eval-and-compile
(unless (and (fboundp 'require-theme)
load-file-name
(equal (file-name-directory load-file-name)
(expand-file-name "themes/" data-directory))
(require-theme 'modus-themes t))
(require 'modus-themes))
;;;###theme-autoload
(deftheme modus-vivendi-tritanopia
"Tritanopia-optimized theme with a black background.
This variant is optimized for users with blue-yellow color
deficiency (tritanopia). It conforms with the highest
legibility standard for color contrast between background and
foreground in any given piece of text, which corresponds to a
minimum contrast in relative luminance of 7:1 (WCAG AAA
standard)."
:background-mode 'dark
:kind 'color-scheme
:family 'modus)
(defconst modus-vivendi-tritanopia-palette
'(
;;; Basic values
(bg-main "#000000")
(bg-dim "#1e1e1e")
(fg-main "#ffffff")
(fg-dim "#989898")
(fg-alt "#a0d7f2")
(bg-active "#535353")
(bg-inactive "#303030")
(border "#646464")
;;; Common accent foregrounds
(red "#ff5f59")
(red-warmer "#ff6740")
(red-cooler "#ff7f86")
(red-faint "#ff9070")
(red-intense "#ff5f5f")
(green "#44bc44")
(green-warmer "#70b900")
(green-cooler "#00c06f")
(green-faint "#88ca9f")
(green-intense "#44df44")
(yellow "#cabf00")
(yellow-warmer "#ffa00f")
(yellow-cooler "#d8af7a")
(yellow-faint "#d2b580")
(yellow-intense "#efef00")
(blue "#2fafff")
(blue-warmer "#79a8ff")
(blue-cooler "#00bcff")
(blue-faint "#82b0ec")
(blue-intense "#338fff")
(magenta "#feacd0")
(magenta-warmer "#f78fe7")
(magenta-cooler "#b6a0ff")
(magenta-faint "#caa6df")
(magenta-intense "#ef7fff")
(cyan "#00d3d0")
(cyan-warmer "#4ae2ff")
(cyan-cooler "#6ae4b9")
(cyan-faint "#7fdbdf")
(cyan-intense "#00eff0")
;;; Uncommon accent foregrounds
(rust "#db7b5f")
(gold "#c0965b")
(olive "#9cbd6f")
(slate "#76afbf")
(indigo "#9099d9")
(maroon "#cf7fa7")
(pink "#d09dc0")
;;; Common accent backgrounds
(bg-red-intense "#9d1f1f")
(bg-green-intense "#2f822f")
(bg-yellow-intense "#7a6100")
(bg-blue-intense "#1640b0")
(bg-magenta-intense "#7030af")
(bg-cyan-intense "#2266ae")
(bg-red-subtle "#620f2a")
(bg-green-subtle "#00422a")
(bg-yellow-subtle "#4a4000")
(bg-blue-subtle "#242679")
(bg-magenta-subtle "#552f5f")
(bg-cyan-subtle "#004065")
(bg-red-nuanced "#3a0c14")
(bg-green-nuanced "#092f1f")
(bg-yellow-nuanced "#381d0f")
(bg-blue-nuanced "#12154a")
(bg-magenta-nuanced "#2f0c3f")
(bg-cyan-nuanced "#042837")
;;; Uncommon accent background and foreground pairs
(bg-clay "#49191a")
(fg-clay "#f1b090")
(bg-ochre "#462f20")
(fg-ochre "#e0d09c")
(bg-lavender "#38325c")
(fg-lavender "#dfc0f0")
(bg-sage "#143e32")
(fg-sage "#c3e7d4")
;;; Graphs
(bg-graph-red-0 "#b52c2c")
(bg-graph-red-1 "#702020")
(bg-graph-green-0 "#afd1c0")
(bg-graph-green-1 "#607a8f")
(bg-graph-yellow-0 "#facfd6")
(bg-graph-yellow-1 "#b57b85")
(bg-graph-blue-0 "#4f9fdf")
(bg-graph-blue-1 "#004559")
(bg-graph-magenta-0 "#b6427f")
(bg-graph-magenta-1 "#7f506f")
(bg-graph-cyan-0 "#57dfea")
(bg-graph-cyan-1 "#00808f")
;;; Special purpose
(bg-completion "#004253")
(bg-hover "#8e3e3b")
(bg-hover-secondary "#204853")
(bg-hl-line "#2f3849")
(bg-region "#5a5a5a")
(fg-region "#ffffff")
(bg-mode-line-active "#003c52")
(fg-mode-line-active "#f0f0f0")
(border-mode-line-active "#5f8fb4")
(bg-mode-line-inactive "#2d2d2d")
(fg-mode-line-inactive "#969696")
(border-mode-line-inactive "#606060")
(modeline-err "#ff7fbf")
(modeline-warning "#df9f93")
(modeline-info "#4fcfef")
(bg-tab-bar "#313131")
(bg-tab-current "#000000")
(bg-tab-other "#545454")
;;; Diffs
(bg-added "#004254")
(bg-added-faint "#003042")
(bg-added-refine "#004f7f")
(bg-added-fringe "#008fcf")
(fg-added "#9fdfdf")
(fg-added-intense "#50c0ef")
(bg-changed "#2f123f")
(bg-changed-faint "#1f022f")
(bg-changed-refine "#3f325f")
(bg-changed-fringe "#7f55a0")
(fg-changed "#e3cfff")
(fg-changed-intense "#cf9fe2")
(bg-removed "#4f1119")
(bg-removed-faint "#380a0f")
(bg-removed-refine "#781a1f")
(bg-removed-fringe "#b81a1f")
(fg-removed "#ffbfbf")
(fg-removed-intense "#ff9095")
(bg-diff-context "#1a1a1a")
;;; Paren match
(bg-paren-match "#2f7f9f")
(fg-paren-match fg-main)
(bg-paren-expression "#453040")
(underline-paren-match unspecified)
;;; Mappings
;;;; General mappings
(fringe bg-dim)
(cursor red-intense)
(keybind red)
(name red-cooler)
(identifier red-faint)
(err red-warmer)
(warning magenta)
(info cyan)
(underline-err red-intense)
(underline-warning magenta-intense)
(underline-note cyan-intense)
(bg-prominent-err bg-red-intense)
(fg-prominent-err fg-main)
(bg-prominent-warning bg-magenta-intense)
(fg-prominent-warning fg-main)
(bg-prominent-note bg-cyan-intense)
(fg-prominent-note fg-main)
(bg-active-argument bg-red-nuanced)
(fg-active-argument red-warmer)
(bg-active-value bg-cyan-nuanced)
(fg-active-value cyan)
;;;; Code mappings
(bracket fg-main)
(builtin magenta)
(comment red-faint)
(constant green-faint)
(delimiter fg-main)
(docmarkup magenta-faint)
(docstring fg-alt)
(fnname cyan-warmer)
(keyword red-cooler)
(number fg-main)
(operator fg-main)
(preprocessor red-warmer)
(property cyan-cooler)
(punctuation fg-main)
(rx-backslash magenta)
(rx-construct red)
(string cyan)
(type blue-warmer)
(variable cyan-cooler)
;;;; Accent mappings
(accent-0 cyan)
(accent-1 red-warmer)
(accent-2 cyan-cooler)
(accent-3 magenta)
;;;; Button mappings
(fg-button-active fg-main)
(fg-button-inactive fg-dim)
(bg-button-active bg-active)
(bg-button-inactive bg-dim)
;;;; Completion mappings
(fg-completion-match-0 cyan)
(fg-completion-match-1 red-warmer)
(fg-completion-match-2 magenta)
(fg-completion-match-3 cyan-cooler)
(bg-completion-match-0 unspecified)
(bg-completion-match-1 unspecified)
(bg-completion-match-2 unspecified)
(bg-completion-match-3 unspecified)
;;;; Date mappings
(date-common cyan-cooler)
(date-deadline red)
(date-deadline-subtle red-faint)
(date-event fg-alt)
(date-holiday red-intense)
(date-holiday-other cyan-warmer)
(date-now fg-main)
(date-range fg-alt)
(date-scheduled magenta)
(date-scheduled-subtle magenta-faint)
(date-weekday cyan)
(date-weekend magenta-warmer)
;;;; Line number mappings
(fg-line-number-inactive fg-dim)
(fg-line-number-active fg-main)
(bg-line-number-inactive bg-dim)
(bg-line-number-active bg-active)
;;;; Link mappings
(fg-link cyan)
(bg-link unspecified)
(underline-link cyan)
(fg-link-symbolic cyan-cooler)
(bg-link-symbolic unspecified)
(underline-link-symbolic cyan-cooler)
(fg-link-visited magenta)
(bg-link-visited unspecified)
(underline-link-visited magenta)
;;;; Mail mappings
(mail-cite-0 cyan-faint)
(mail-cite-1 red-faint)
(mail-cite-2 magenta-warmer)
(mail-cite-3 cyan-warmer)
(mail-part cyan-cooler)
(mail-recipient cyan)
(mail-subject red-cooler)
(mail-other cyan)
;;;; Mark mappings
(bg-mark-delete bg-red-subtle)
(fg-mark-delete red)
(bg-mark-select bg-cyan-subtle)
(fg-mark-select cyan)
(bg-mark-other bg-magenta-subtle)
(fg-mark-other magenta-warmer)
;;;; Prompt mappings
(fg-prompt cyan-cooler)
(bg-prompt unspecified)
;;;; Prose mappings
(bg-prose-block-delimiter bg-dim)
(fg-prose-block-delimiter fg-dim)
(bg-prose-block-contents bg-dim)
(bg-prose-code unspecified)
(fg-prose-code cyan)
(bg-prose-macro unspecified)
(fg-prose-macro red-warmer)
(bg-prose-verbatim unspecified)
(fg-prose-verbatim magenta-warmer)
(prose-done cyan)
(prose-todo red)
(prose-metadata fg-dim)
(prose-metadata-value fg-alt)
(prose-table fg-alt)
(prose-table-formula red-cooler)
(prose-tag fg-alt)
;;;; Rainbow mappings
(rainbow-0 cyan)
(rainbow-1 red)
(rainbow-2 cyan-warmer)
(rainbow-3 red-cooler)
(rainbow-4 cyan-cooler)
(rainbow-5 magenta)
(rainbow-6 cyan-faint)
(rainbow-7 magenta-faint)
(rainbow-8 red-faint)
;;;; Search mappings
(bg-search-current bg-red-intense)
(bg-search-lazy bg-cyan-intense)
(bg-search-replace bg-magenta-intense)
(bg-search-rx-group-0 bg-blue-intense)
(bg-search-rx-group-1 bg-magenta-intense)
(bg-search-rx-group-2 bg-cyan-subtle)
(bg-search-rx-group-3 bg-red-subtle)
;;;; Space mappings
(bg-space unspecified)
(fg-space border)
(bg-space-err bg-red-intense)
;;;; Terminal mappings
(bg-term-black "#000000")
(fg-term-black "#000000")
(bg-term-black-bright "#595959")
(fg-term-black-bright "#595959")
(bg-term-red red)
(fg-term-red red)
(bg-term-red-bright red-warmer)
(fg-term-red-bright red-warmer)
(bg-term-green green)
(fg-term-green green)
(bg-term-green-bright green-cooler)
(fg-term-green-bright green-cooler)
(bg-term-yellow yellow)
(fg-term-yellow yellow)
(bg-term-yellow-bright yellow-warmer)
(fg-term-yellow-bright yellow-warmer)
(bg-term-blue blue)
(fg-term-blue blue)
(bg-term-blue-bright blue-warmer)
(fg-term-blue-bright blue-warmer)
(bg-term-magenta magenta)
(fg-term-magenta magenta)
(bg-term-magenta-bright magenta-cooler)
(fg-term-magenta-bright magenta-cooler)
(bg-term-cyan cyan)
(fg-term-cyan cyan)
(bg-term-cyan-bright cyan-cooler)
(fg-term-cyan-bright cyan-cooler)
(bg-term-white "#a6a6a6")
(fg-term-white "#a6a6a6")
(bg-term-white-bright "#ffffff")
(fg-term-white-bright "#ffffff")
;;;; Heading mappings
(fg-heading-0 cyan-cooler)
(fg-heading-1 fg-main)
(fg-heading-2 red-faint)
(fg-heading-3 cyan-faint)
(fg-heading-4 magenta)
(fg-heading-5 green-faint)
(fg-heading-6 magenta-faint)
(fg-heading-7 cyan-faint)
(fg-heading-8 fg-dim)
(bg-heading-0 unspecified)
(bg-heading-1 unspecified)
(bg-heading-2 unspecified)
(bg-heading-3 unspecified)
(bg-heading-4 unspecified)
(bg-heading-5 unspecified)
(bg-heading-6 unspecified)
(bg-heading-7 unspecified)
(bg-heading-8 unspecified)
(overline-heading-0 unspecified)
(overline-heading-1 unspecified)
(overline-heading-2 unspecified)
(overline-heading-3 unspecified)
(overline-heading-4 unspecified)
(overline-heading-5 unspecified)
(overline-heading-6 unspecified)
(overline-heading-7 unspecified)
(overline-heading-8 unspecified))
"The entire palette of the `modus-vivendi-tritanopia' theme.
Named colors have the form (COLOR-NAME HEX-VALUE) with the former
as a symbol and the latter as a string.
Semantic color mappings have the form (MAPPING-NAME COLOR-NAME)
with both as symbols. The latter is a named color that already
exists in the palette and is associated with a HEX-VALUE.")
(defcustom modus-vivendi-tritanopia-palette-user nil
"Like the `modus-vivendi-tritanopia-palette' for user-defined entries.
(unless (and (fboundp 'require-theme)
load-file-name
(equal (file-name-directory load-file-name)
(expand-file-name "themes/" data-directory))
(require-theme 'modus-themes t))
(require 'modus-themes))
(defcustom modus-vivendi-tritanopia-palette-user nil
"Like the `modus-vivendi-tritanopia-palette' for user-defined entries.
This is meant to extend the palette with custom named colors and/or
semantic palette mappings. Those may then be used in combination with
palette overrides (also see `modus-themes-common-palette-overrides' and
`modus-vivendi-tritanopia-palette-overrides')."
:group 'modus-themes
:package-version '(modus-themes . "4.5.0")
:type '(repeat (list symbol (choice symbol string)))
:set #'modus-themes--set-option
:initialize #'custom-initialize-default
:link '(info-link "(modus-themes) Option to extend the palette for use with overrides"))
:group 'modus-themes
:package-version '(modus-themes . "4.5.0")
:type '(repeat (list symbol (choice symbol string)))
:link '(info-link "(modus-themes) Option to extend the palette for use with overrides"))
(defcustom modus-vivendi-tritanopia-palette-overrides nil
"Overrides for `modus-vivendi-tritanopia-palette'.
(defcustom modus-vivendi-tritanopia-palette-overrides nil
"Overrides for `modus-vivendi-tritanopia-palette'.
Mirror the elements of the aforementioned palette, overriding
their value.
@ -523,18 +68,28 @@ mappings, such as to make the cursor red. Wherea theme-specific
overrides can also be used to change the value of a named color,
such as what hexadecimal RGB value the red-warmer symbol
represents."
:group 'modus-themes
:package-version '(modus-themes . "4.0.0")
:version "30.1"
:type '(repeat (list symbol (choice symbol string)))
:set #'modus-themes--set-option
:initialize #'custom-initialize-default
:link '(info-link "(modus-themes) Palette overrides"))
:group 'modus-themes
:package-version '(modus-themes . "4.0.0")
:version "30.1"
:type '(repeat (list symbol (choice symbol string)))
:link '(info-link "(modus-themes) Palette overrides"))
(modus-themes-theme modus-vivendi-tritanopia
modus-vivendi-tritanopia-palette
modus-vivendi-tritanopia-palette-overrides)
(modus-themes-theme
'modus-vivendi-tritanopia
'modus-themes
"Tritanopia-optimized theme with a black background.
This variant is optimized for users with blue-yellow color
deficiency (tritanopia). It conforms with the highest
legibility standard for color contrast between background and
foreground in any given piece of text, which corresponds to a
minimum contrast in relative luminance of 7:1 (WCAG AAA
standard)."
'dark
'modus-themes-vivendi-tritanopia-palette
'modus-vivendi-tritanopia-palette-user
'modus-vivendi-tritanopia-palette-overrides
'modus-themes-faces-tritanopia)
(provide-theme 'modus-vivendi-tritanopia))
(provide 'modus-vivendi-tritanopia-theme)
;;; modus-vivendi-tritanopia-theme.el ends here

372
tests/modus-themes-test.el Normal file
View file

@ -0,0 +1,372 @@
;;; modus-themes-test.el --- Unit tests for the Modus themes -*- lexical-binding: t -*-
;; Copyright (C) 2025-2026 Free Software Foundation, Inc.
;; Author: Protesilaos <info@protesilaos.com>,
;; Rudolf Adamkovič <rudolf@adamkovic.org>
;; Maintainer: Protesilaos <info@protesilaos.com>
;; URL: https://github.com/protesilaos/modus-themes
;; This file is NOT part of GNU Emacs.
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; Tests for the Modus themes. Note that we are using Shorthands in
;; this file, so the "mtt-" prefix really is "modus-themes-test-".
;; Evaluate the following to learn more:
;;
;; (info "(elisp) Shorthands")
;;; Code:
(require 'ert)
(require 'modus-themes)
(defmacro mtt-define-test (symbol &rest body)
"Write test for SYMBOL with BODY forms.
If the `car' of BODY is a string, use it as the docstring of the test.
Else provide a generic snippet of text."
(declare (doc-string 2) (indent defun))
(let* ((first (car body))
(has-docstring (stringp first))
(docstring (if has-docstring
first
(format "Test that `%s' does the right thing." symbol)))
(body (if has-docstring (cdr body) body)))
`(ert-deftest ,(intern (format "mtt-%s" symbol)) ()
,docstring
,@body)))
(mtt-define-test modus-themes--color-hex-p
(should (modus-themes--color-hex-p "#123"))
(should (modus-themes--color-hex-p "#123456"))
(should (modus-themes--color-hex-p "#abc"))
(should (modus-themes--color-hex-p "#ABCDEF"))
(should-not (modus-themes--color-hex-p "abc"))
(should-not (modus-themes--color-hex-p "#abcd"))
(should-not (modus-themes--color-hex-p "#12345"))
(should-not (modus-themes--color-hex-p "#1234567"))
(should-not (modus-themes--color-hex-p "#zzz"))
(should-not (modus-themes--color-hex-p "#zzz"))
(should-not (modus-themes--color-hex-p "#12g456")))
(mtt-define-test modus-themes--hex-or-name-to-rgb
(should (equal (modus-themes--hex-or-name-to-rgb "#fff") (list 1.0 1.0 1.0)))
(should (equal (modus-themes--hex-or-name-to-rgb "#000") (list 0.0 0.0 0.0)))
(should (equal (modus-themes--hex-or-name-to-rgb "#f00") (list 1.0 0.0 0.0)))
(should (equal (modus-themes--hex-or-name-to-rgb "#0f0") (list 0.0 1.0 0.0)))
(should (equal (modus-themes--hex-or-name-to-rgb "#00f") (list 0.0 0.0 1.0)))
(should (equal (modus-themes--hex-or-name-to-rgb "#ffffff") (list 1.0 1.0 1.0)))
(should (equal (modus-themes--hex-or-name-to-rgb "#000000") (list 0.0 0.0 0.0)))
(should (equal (modus-themes--hex-or-name-to-rgb "#ff0000") (list 1.0 0.0 0.0)))
(should (equal (modus-themes--hex-or-name-to-rgb "#00ff00") (list 0.0 1.0 0.0)))
;; NOTE 2026-04-12: I do not need it to be precise here, hence the `format'.
(let ((rgb-rounded-fn
(lambda (hex)
(let ((rgb (modus-themes--hex-or-name-to-rgb hex)))
(mapcar (lambda (float) (string-to-number (format "%.2f" float))) rgb)))))
(should (equal (funcall rgb-rounded-fn "#800000") (list 0.5 0.0 0.0)))
(should (equal (funcall rgb-rounded-fn "#008000") (list 0.0 0.5 0.0)))
(should (equal (funcall rgb-rounded-fn "#000080") (list 0.0 0.0 0.5))))
(should-error (modus-themes--hex-or-name-to-rgb ""))
(should-error (modus-themes--hex-or-name-to-rgb "#"))
(should-error (modus-themes--hex-or-name-to-rgb "#1"))
(should-error (modus-themes--hex-or-name-to-rgb "#12"))
(should-error (modus-themes--hex-or-name-to-rgb "#1234"))
(should-error (modus-themes--hex-or-name-to-rgb "#12345"))
(should-error (modus-themes--hex-or-name-to-rgb "#gggggg"))
(should-error (modus-themes--hex-or-name-to-rgb (list 1.0 1.0 1.0))))
(mtt-define-test modus-themes-wcag-formula
"Test that `modus-themes-wcag-formula' does the right thing.
Also see `modus-themes-test--modus-themes--hex-to-rgb'."
(should (= (modus-themes-wcag-formula "#ffffff") 1.0))
(should (= (modus-themes-wcag-formula "#000000") 0.0))
(should-error (modus-themes-wcag-formula "#00000")))
(mtt-define-test modus-themes-contrast
"Test that `modus-themes-contrast' works as intended.
Also see `modus-themes-test--modus-themes--hex-to-rgb'."
(should (= (modus-themes-contrast "#ffffff" "#000000") 21.0))
(should (= (modus-themes-contrast "#000000" "#ffffff") 21.0))
;; NOTE 2026-04-12: I do not need it to be precise here, hence the `format'.
(let ((float-2-fn (lambda (hex1 hex2) (string-to-number (format "%.2f" (modus-themes-contrast hex1 hex2))))))
(should (= (funcall float-2-fn "#ff0000" "#ffffff") 4.0))
(should (= (funcall float-2-fn "#00ff00" "#ffffff") 1.37))
(should (= (funcall float-2-fn "#0000ff" "#ffffff") 8.59))
(should (= (funcall float-2-fn "#ffff00" "#ffffff") 1.07))
(should (= (funcall float-2-fn "#00ffff" "#ffffff") 1.25))
(should (= (funcall float-2-fn "#ff00ff" "#ffffff") 3.14)))
(should-error (modus-themes-contrast "#ffffff" "#00000"))
(should-error (modus-themes-contrast "#fffff" "#00000")))
(mtt-define-test modus-themes--color-eight-to-six-digits
(should (string= (modus-themes--color-eight-to-six-digits "#f00") "#f00"))
(should (string= (modus-themes--color-eight-to-six-digits "#ff1919") "#ff1919"))
(should (string= (modus-themes--color-eight-to-six-digits "#ffff19991999") "#ff1919")))
(mtt-define-test modus-themes-adjust-value
"Test that `modus-themes-adjust-value' does the right thing.
Also see `modus-themes-test--modus-themes--hex-to-rgb'."
(should (string= (modus-themes-adjust-value "#ff0000" 10) "#ff1919"))
(should (string= (modus-themes-adjust-value "#505050" 100) "#ffffff"))
(should (string= (modus-themes-adjust-value "#505050" -100) "#000000"))
(should (string= (modus-themes-adjust-value "#505050" 0) "#505050"))
(should-error (modus-themes-adjust-value "#ff00" 10)))
(mtt-define-test modus-themes-activate
(if (custom-theme-p 'modus-operandi-tritanopia)
(should-not (modus-themes-activate 'modus-operandi-tritanopia))
(should (custom-theme-p 'modus-operandi-tritanopia))))
(mtt-define-test modus-themes--belongs-to-family-p
(should (modus-themes--belongs-to-family-p 'modus-operandi 'modus-themes))
(should-not (modus-themes--belongs-to-family-p 'my-fancy-theme 'modus-themes))
(should-not (modus-themes--belongs-to-family-p 'modus-operandi 'my-fancy-themes)))
(mtt-define-test modus-themes-get-all-known-themes
(should (equal (modus-themes-get-all-known-themes) modus-themes-items))
(should-not (modus-themes-get-all-known-themes 'my-fancy-themes)))
(mtt-define-test modus-themes--background-p
(should (modus-themes--background-p 'modus-operandi 'light))
(should-not (modus-themes--background-p 'modus-operandi 'dark))
(should-not (modus-themes--background-p 'modus-operandi t))
(should-not (modus-themes--background-p 'modus-operandi :light)))
(mtt-define-test modus-themes-sort
(let ((first-has-prefix-fn (lambda (themes prefix)
(when-let* ((first (car themes))
(name (symbol-name first)))
(string-match-p prefix name)))))
(should (funcall first-has-prefix-fn (modus-themes-sort (reverse modus-themes-items) 'light) "modus-operandi"))
(should (funcall first-has-prefix-fn (modus-themes-sort modus-themes-items 'dark) "modus-vivendi"))))
(mtt-define-test inheritance
"Ensure all faces inherit from valid faces."
;; Third-party packages, loaded if possible to better test face inheritance.
(require 'font-latex nil t)
(let ((current-theme (modus-themes-get-current-theme)))
(unwind-protect
(progn
(modus-themes-load-theme 'modus-operandi)
(should-not (seq-filter
(lambda (face)
;; The face either has no parent ...
(if-let* ((parent (face-attribute face :inherit)))
(and (symbolp parent)
(not (eq parent 'unspecified))
;; ... or its parent is a valid face.
(not (facep parent)))))
(face-list))))
(modus-themes-load-theme current-theme))))
(mtt-define-test color-dark-p
(let ((modus-operandi-sample-foregrounds
'("#a60000"
"#972500"
"#a0132f"
"#7f0000"
"#006800"
"#316500"
"#00663f"
"#2a5045"
"#6f5500"
"#884900"
"#7a4f2f"
"#624416"
"#0031a9"
"#3548cf"
"#0000b0"
"#003497"
"#721045"
"#8f0075"
"#531ab6"
"#7c318f"
"#005e8b"
"#3f578f"
"#005f5f"
"#005077"))
(modus-vivendi-sample-foregrounds
'("#ff5f59"
"#ff6b55"
"#ff7f86"
"#ff9580"
"#44bc44"
"#70b900"
"#00c06f"
"#88ca9f"
"#d0bc00"
"#fec43f"
"#dfaf7a"
"#d2b580"
"#2fafff"
"#79a8ff"
"#00bcff"
"#82b0ec"
"#feacd0"
"#f78fe7"
"#b6a0ff"
"#caa6df"
"#00d3d0"
"#4ae2f0"
"#6ae4b9"
"#9ac8e0")))
(should (seq-every-p #'modus-themes-color-dark-p modus-operandi-sample-foregrounds))
(should-not (seq-every-p #'modus-themes-color-dark-p modus-vivendi-sample-foregrounds))))
(mtt-define-test get-readable-foreground
(let ((modus-operandi-sample-foregrounds
'("#a60000"
"#972500"
"#a0132f"
"#7f0000"
"#006800"
"#316500"
"#00663f"
"#2a5045"
"#6f5500"
"#884900"
"#7a4f2f"
"#624416"
"#0031a9"
"#3548cf"
"#0000b0"
"#003497"
"#721045"
"#8f0075"
"#531ab6"
"#7c318f"
"#005e8b"
"#3f578f"
"#005f5f"
"#005077"))
(modus-vivendi-sample-foregrounds
'("#ff5f59"
"#ff6b55"
"#ff7f86"
"#ff9580"
"#44bc44"
"#70b900"
"#00c06f"
"#88ca9f"
"#d0bc00"
"#fec43f"
"#dfaf7a"
"#d2b580"
"#2fafff"
"#79a8ff"
"#00bcff"
"#82b0ec"
"#feacd0"
"#f78fe7"
"#b6a0ff"
"#caa6df"
"#00d3d0"
"#4ae2f0"
"#6ae4b9"
"#9ac8e0")))
(should (seq-every-p
(lambda (value)
(string= value "#ffffff"))
(mapcar #'modus-themes-get-readable-foreground modus-operandi-sample-foregrounds)))
(should (seq-every-p
(lambda (value)
(string= value "#000000"))
(mapcar #'modus-themes-get-readable-foreground modus-vivendi-sample-foregrounds)))))
(mtt-define-test complete-palette-mappings
"Ensure all built-in palettes contain entries for all palette mappings.
This computes a complete list of mapping names from the built-in palettes
and then cross-checks the palettes against the list. This should help ensure
consistency and completeness where adding a new mapping in one palette will
fail this test until it is added in all palettes."
(let* ((operandi-names (seq-uniq (mapcar #'car modus-themes-operandi-palette)))
(operandi-tinted-names (seq-uniq (mapcar #'car modus-themes-operandi-tinted-palette)))
(operandi-deuteranopia-names (seq-uniq (mapcar #'car modus-themes-operandi-deuteranopia-palette)))
(operandi-tritanopia-names (seq-uniq (mapcar #'car modus-themes-operandi-tritanopia-palette)))
(vivendi-names (seq-uniq (mapcar #'car modus-themes-vivendi-palette)))
(vivendi-tinted-names (seq-uniq (mapcar #'car modus-themes-vivendi-tinted-palette)))
(vivendi-deuteranopia-names (seq-uniq (mapcar #'car modus-themes-vivendi-deuteranopia-palette)))
(vivendi-tritanopia-names (seq-uniq (mapcar #'car modus-themes-vivendi-tritanopia-palette)))
(all-names (seq-uniq (append operandi-names
operandi-tinted-names
operandi-deuteranopia-names
operandi-tritanopia-names
vivendi-names
vivendi-tinted-names
vivendi-deuteranopia-names
vivendi-tritanopia-names))))
(should (seq-empty-p (seq-difference all-names operandi-names)))
(should (seq-empty-p (seq-difference all-names operandi-tinted-names)))
(should (seq-empty-p (seq-difference all-names operandi-deuteranopia-names)))
(should (seq-empty-p (seq-difference all-names operandi-tritanopia-names)))
(should (seq-empty-p (seq-difference all-names vivendi-names)))
(should (seq-empty-p (seq-difference all-names vivendi-tinted-names)))
(should (seq-empty-p (seq-difference all-names vivendi-deuteranopia-names)))
(should (seq-empty-p (seq-difference all-names vivendi-tritanopia-names)))))
(mtt-define-test modus-themes-generate-palette
"Ensure `modus-themes-generate-palette' provides enough mapping coverage
such that the generated palette does not inherit explicit color values
from a parent core palette."
(let* ((generated-palette (modus-themes-generate-palette
'((fg-main "#ffffff")
(bg-main "#000000")
(red "#ff0000")
(green "#00ff00")
(yellow "#ffff00")
(blue "#0000ff")
(magenta "#ff00ff")
(cyan "#00ffff"))))
;; These are colors we expect to have an explicit hex value,
;; either because they were provided explicitly in the call to
;; `modus-themes-generate-palette' above, or because we expect
;; `modus-themes-generate-palette' to generate the color.
(explicit-colors '( fg-main bg-main
fg-alt fg-dim bg-inactive bg-active bg-dim border
;; cyan
cyan bg-cyan-nuanced bg-cyan-subtle bg-cyan-intense
cyan-intense cyan-faint cyan-cooler cyan-warmer
;; magenta
magenta bg-magenta-nuanced bg-magenta-subtle bg-magenta-intense
magenta-intense magenta-faint magenta-cooler magenta-warmer
;; blue
blue bg-blue-nuanced bg-blue-subtle bg-blue-intense
blue-intense blue-faint blue-cooler blue-warmer
;; yellow
yellow bg-yellow-nuanced bg-yellow-subtle bg-yellow-intense
yellow-intense yellow-faint yellow-cooler yellow-warmer
;; green
green bg-green-nuanced bg-green-subtle bg-green-intense
green-intense green-faint green-cooler green-warmer
;; red
red bg-red-nuanced bg-red-subtle bg-red-intense
red-intense red-faint red-cooler red-warmer)))
;; Ensure all other colors in the palette map to a color name and not an
;; explicit hex value. If this check fails, the offending color should
;; be mapped to an appropriate color name in `modus-themes-generate-palette'.
(should (seq-empty-p (seq-remove (lambda (elem)
(or (member (car elem) explicit-colors)
(symbolp (cadr elem))))
generated-palette)))))
(provide 'modus-themes-test)
;;; modus-themes-test.el ends here
;; Local Variables:
;; read-symbol-shorthands: (("mtt" . "modus-themes-test-"))
;; End: