Compare commits

...

176 commits
5.2.0 ... 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
14 changed files with 3141 additions and 2983 deletions

View file

@ -1,5 +1,5 @@
#+TITLE: Change log of the Modus Themes for GNU Emacs
#+AUTHOR: Protesilaos Stavrou
#+AUTHOR: Protesilaos
#+EMAIL: info@protesilaos.com
#+OPTIONS: ':nil toc:nil num:nil author:nil email:nil
@ -15,13 +15,249 @@ For further details, please consult these additional resources:
+ Manual :: <https://protesilaos.com/emacs/modus-themes>
+ Screenshots :: <https://protesilaos.com/emacs/modus-themes-pictures>
* 5.3.0 on 2026-06-21
:PROPERTIES:
:CUSTOM_ID: h:b4fa17a7-77a3-4e54-9af8-6a413b6b4e7c
:END:
The Modus themes are in a stable state. To my mind, they provide the
best "default theme" experience across the 40+ original themes I have
carefully designed.
Modus is also a platform for making themes for Emacs. There are plenty
of derivatives already. I am linking to them through the project's
README.md and am always happy to mention more packages---just let me
know.
This version does not include many user-facing changes. Most of my
work focused on making internal refinements.
** Load the themes through the =early-init.el=
:PROPERTIES:
:CUSTOM_ID: h:4d80aeaa-e93f-4cca-a2b2-792700081ead
:END:
The Modus themes can now be loaded through the =early-init.el= file.
The idea is to avoid the flash of light that occurs under certain
conditions during startup.
This feature is the result of several changes to helper functions,
especially those contributing to the ~modus-themes-generate-palette~
function that Modus derivatives may be relying on.
Thanks to Steven Allen for an intermediate refinement in pull request
194 and to Mike Olson for another relevant tweak in pull request 199:
- <https://github.com/protesilaos/modus-themes/pull/194>
- <https://github.com/protesilaos/modus-themes/pull/199>
Steven's contribution no longer exists in the code base due to other
changes I made, but was still useful at the time.
Both changes are small, meaning that their authors do not need to
assign copyright to the Free Software Foundation.
Also thanks to Jacod "Jake" Gordon for reminding me to apply one of
the new functions to the ~org-habit~ faces. This was done in issue
197: <https://github.com/protesilaos/modus-themes/issues/197>.
** The underline for widget fields has the correct colour
:PROPERTIES:
:CUSTOM_ID: h:c936a591-25ff-440d-88e8-e710da2c3f59
:END:
Relevant faces use the palette entry for =border= (invoke the command
~modus-themes-preview-colors~ or ~modus-themes-preview-colors-current~
to view the entries in a theme's palette).
A popular package that makes use of =widget.el= widgets is ~notmuch~.
Thanks to ukiran03 for the contribution, which 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.
** A palette can now have a =bg-popup= entry
:PROPERTIES:
:CUSTOM_ID: h:bb9166ae-2424-4edf-8004-91e99ff8555a
:END:
This gives users and derivative themes the option to pick a suitable
value for popup interfaces, such as those of the ~company~ and ~corfu~
packages.
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~ since Modus version =5.0.0=, Ef version =2.0.0=):
<https://github.com/protesilaos/ef-themes/issues/70>.
** Support for faces or packages
:PROPERTIES:
:CUSTOM_ID: h:cb1de864-f749-46e6-a8c4-1b5c47a59aff
:END:
- ~lin~ by Protesilaos.
- ~pulsar~ by Protesilaos.
- ~institution-calendar~ by Protesilaos.
- ~markdown-ts-mode~ by Rahul Martim Juliato and Stéphane Marks.
- ~trust-manager~ by Eshel Yaron.
- ~typst-ts-mode~ by Ziqi Yang. Thanks to Pranshu Sharma for
suggesting its inclusion in issue 208:
<https://github.com/protesilaos/modus-themes/issues/208>.
- new ~elfeed~ faces since the maintenance of the project was assumed
by Daniel Mendler, Karthik Chikmagalur, and Ihor Radchenko. To this
end, thanks to Steven Allen for pull request 217 that added the
=elfeed-show-*= faces: <https://github.com/protesilaos/modus-themes/pull/217>
** Internal refinements to the ~modus-themes-with-colors~ macro
:PROPERTIES:
:CUSTOM_ID: h:36d438e6-2779-4e34-b9ae-bb26503643ed
:END:
It now correctly handles the order of default palette colours and
user-defined palette overrides. Thanks to JD Smith for the
contribution in pull request 191: <https://github.com/protesilaos/modus-themes/pull/191>.
The change is small, meaning that JD does not need to assign copyright
to the Free Software Foundation.
** The ~multiple-cursors~ are fine even when a bar is used
:PROPERTIES:
:CUSTOM_ID: h:d707af16-66c9-4520-bd96-129e7b0511dd
:END:
When the ~cursor-type~ is configured to be a =bar=, the fake cursors
produced by the ~multiple-cursors~ package will still look right.
Thanks to Elias Gabriel Perez for the change to the
~mc/cursor-bar-face~ in pull request 213: <https://github.com/protesilaos/modus-themes/pull/213>.
** The ~blink-matching-paren-offscreen~ is the same as ~show-paren-match~
:PROPERTIES:
:CUSTOM_ID: h:025061cd-ebdf-47bd-a596-9e8e9d6afa7d
:END:
This is for thematic consistency. Thanks to Troy Brown for suggesting
this change in issue 209: <https://github.com/protesilaos/modus-themes/issues/209>.
** Get ~vc-annotate~ look right
:PROPERTIES:
:CUSTOM_ID: h:73e5911d-fe08-43b4-b3d9-e5a79af447b0
:END:
The built-in ~vc-annotate~ command relies on a user option to read
color values. We cannot handle this nicely at the theme level. Users
need to write their own configuration like this:
#+begin_src emacs-lisp
(defun my-modus-vc-annotate (&rest _)
(modus-themes-with-colors
(setq vc-annotate-background-mode nil)
(setq vc-annotate-very-old-color fg-dim)
(setq vc-annotate-color-map
`(( 20. . ,red)
( 40. . ,red-cooler)
( 60. . ,red-warmer)
( 80. . ,yellow-warmer)
(100. . ,yellow)
(120. . ,yellow-cooler)
(140. . ,green-warmer)
(160. . ,green)
(180. . ,green-cooler)
(200. . ,cyan-cooler)
(220. . ,cyan-warmer)
(240. . ,cyan)
(260. . ,blue-warmer)
(280. . ,blue)
(300. . ,blue-cooler)
(320. . ,blue-intense)
(340. . ,magenta-cooler)
(360. . ,fg-dim)))))
(with-eval-after-load 'vc-annotate
(my-modus-vc-annotate)
(add-hook 'enable-theme-functions #'my-modus-vc-annotate))
#+end_src
[ The above code is relevant as of this writing. Though remember that
I do not keep older publications up-to-date. The only source of
truth is the manual of the Modus themes. ]
** Two old user options are no longer needed
:PROPERTIES:
:CUSTOM_ID: h:39eb95f4-76b1-46b8-8f2e-245591c2ec03
:END:
The user options ~modus-themes-completions~ and ~modus-themes-prompts~
are obsolete. They used to be relevant before the introduction of
palette overrides.
** Rewrote large parts of the manual
:PROPERTIES:
:CUSTOM_ID: h:73703b3a-ef75-4cc0-97ca-344f8d6812ba
:END:
I did it for clarity, but also to remove notes that were specific to
older versions of Emacs.
** Many new ERT tests for the project
:PROPERTIES:
:CUSTOM_ID: h:98134bb3-9eea-4fc2-9f21-bc619508de8a
:END:
I have written many tests. They do not cover every single function,
though the plan is to do that eventually. These tests are important to
ensure that Modus is a solid platform for making derivative themes.
Much of this was done live: <https://protesilaos.com/codelog/2026-04-10-emacs-spontaneous-live-modus-themes/>.
Thanks to Benjamin Kästner for a couple of tweaks to a relevant macro
in the tests' file. This was done in pull request 212, with further
changes by me: <https://github.com/protesilaos/modus-themes/pull/212>.
** Links to projects related to Modus
:PROPERTIES:
:CUSTOM_ID: h:50301743-a109-4d96-83dd-3b8c7c6b90ed
:END:
In the README.md I now mention projects that are related to the Modus
themes, such as derivative Emacs themes, but also ports for other
editors.
There is also a link to my ~modus-themes-exporter~ package, which I
developed during a live stream:
- <https://github.com/protesilaos/modus-themes-exporter>
- <https://protesilaos.com/codelog/2026-04-13-emacs-live-develop-modus-themes-exporter-package/>
** Git commits
:PROPERTIES:
:CUSTOM_ID: h:e869b1e6-5bc1-4d79-83cd-bb3f648c3ebf
:END:
#+begin_src
git shortlog 5.2.0..5.3.0 --summary --numbered
123 Protesilaos
2 Benjamin Kästner
2 Steven Allen
1 Elias Gabriel Perez
1 JD Smith
1 Mike Olson
1 ukiran03
#+end_src
* 5.2.0 on 2025-12-31
:PROPERTIES:
:CUSTOM_ID: h:2c723b97-df07-4a3e-915f-b00f6647f74b
:END:
This version fixes some bugs, adds a new feature for those who want to
derive a theme from Modus, and makes other small quality-of-life
refinements.
** The ~modus-themes-with-colors~ should work at all times
:PROPERTIES:
:CUSTOM_ID: h:fcf14029-fd5f-4404-8ff7-370fb742c00d
:END:
In the transition to version =5.0.0=, I inadvertently introduced
regressions to the behaviour of the ~modus-themes-with-colors~ macro.
@ -39,6 +275,9 @@ Alexandr Semenov and realazy for reporting the problems and testing my
revisions.
** The ~modus-themes-generate-palette~ function to quickly get a palette
:PROPERTIES:
:CUSTOM_ID: h:6786fe0c-3853-4586-89d6-4f60b3828b1c
:END:
Users or package developers who want to create a theme on top of Modus
can now get a kickstart by defining their palette with the help of the
@ -55,6 +294,9 @@ complete example of a Solarized theme that is built on top of Modus.
If you have any questions, you are welcome to contact me.
** Convenience commands to select only dark or light themes
:PROPERTIES:
:CUSTOM_ID: h:deaebb75-129a-4ca2-8fd3-d29ae723474a
:END:
The commands ~modus-themes-select-dark~ and ~modus-themes-select-light~
use minibuffer completion to load a theme. The completion candidates
@ -68,6 +310,9 @@ Remember that we also have the commands ~modus-themes-load-random~,
Otherwise use the command ~modus-themes-rotate~.
** Improved prompt for theme selection
:PROPERTIES:
:CUSTOM_ID: h:fcfe5599-9d12-46cf-8896-e45625aa7304
:END:
The minibuffer prompt used by the various Modus commands to select a
theme now has a grouping function in place: it shows the current theme
@ -78,6 +323,9 @@ is enabled and relevant packages/themes are available (e.g. my
~ef-themes~ and ~standard-themes~).
** Semantic colours for =transient.el= (e.g. in Magit)
:PROPERTIES:
:CUSTOM_ID: h:9bee92ab-e082-4f66-b01c-892860c60a0c
:END:
The =transient.el= concept of "semantic colours" is now supported.
This is used by default in Magit to denote the different types of
@ -92,6 +340,9 @@ refinements I made. Those themes cannot rely on the full colour
spectrum to communicate such nuances.
** All ~hl-todo-mode~ faces use a bold weight if appropriate
:PROPERTIES:
:CUSTOM_ID: h:309dd08f-dc01-47f6-8e88-0558181e1bb8
:END:
When the user option ~modus-themes-bold-constructs~ is set to a
non-~nil~ value, then all keywords that ~hl-todo-mode~ highlights will
@ -101,11 +352,17 @@ mistake. Thanks to Dominik Schrempf for reporting the bug in issue
177: <https://github.com/protesilaos/modus-themes/issues/177>.
** Theme-sensitive colours for Gnus mail groups
:PROPERTIES:
:CUSTOM_ID: h:ea438d6c-2e3e-4427-86af-3d9590e260d3
:END:
The Gnus mail groups no longer have hardcoded colour values. They will
look different depending on the current Modus theme.
** Faces that set a =:box= attribute handle unspecified colours
:PROPERTIES:
:CUSTOM_ID: h:98c4f263-81ad-4bb2-85fc-af30b32584a2
:END:
I updated all faces that use a =:box= attribute to account for the
scenario of a user writing palette overrides that unset the relevant
@ -115,6 +372,9 @@ issue 9 of my ~standard-themes~ repository (they are derived from the
<https://github.com/protesilaos/standard-themes/issues/9>.
** The ~calendar-today~ and ~org-date-selected~ faces are disambiguated
:PROPERTIES:
:CUSTOM_ID: h:c5c7ff66-0ed8-424c-8579-b84b776ad461
:END:
These two faces are no longer using the same styles. This is because
they can appear in the same buffer. Thanks to Rudolf Adamkovič for
@ -123,6 +383,9 @@ discussing this with me in the context of the same change for my
<https://github.com/protesilaos/doric-themes/issues/20>.
** The Modus "current theme" respects multiple enabled themes
:PROPERTIES:
:CUSTOM_ID: h:4c2abd1b-407a-4273-96d8-aba3bb42e0dc
:END:
The Modus concept of "current theme" respects the user's choice for
multiple themes loaded at once. It will return the first Modus theme
@ -144,6 +407,9 @@ This was done in pull request 184:
Pierre has assigned copyright to the Free Software Foundation.
** Fixed symbol of inherited AUCTeX face
:PROPERTIES:
:CUSTOM_ID: h:4caebf48-2544-4367-ad35-61957f5f043b
:END:
There was a typo which caused an error. Thanks to Rudolf Adamkovič for
the patch and also for providing a relevant unit test. This was done
@ -152,6 +418,9 @@ in pull request 188: <https://github.com/protesilaos/modus-themes/pull/188>.
Rudolf has assigned copyright to the Free Software Foundation.
** Miscellaneous
:PROPERTIES:
:CUSTOM_ID: h:738675ea-6f7b-47e5-907e-468b67ecd430
:END:
- Thanks to Basil L. Contovounesios for simplifying a couple of
expressions. This was done in pull request 190:
@ -3185,7 +3454,7 @@ users, while also catering to their aesthetic preferences.
#+begin_src text
Modus themes version 3.0.0
By Protesilaos Stavrou <info@protesilaos.com> on 2022-10-28
By Protesilaos <info@protesilaos.com> on 2022-10-28
The version that will ship with Emacs 29
@ -3361,7 +3630,7 @@ Miscellaneous
#+begin_src text
Modus themes version 2.7.0
By Protesilaos Stavrou <info@protesilaos.com> on 2022-10-01
By Protesilaos <info@protesilaos.com> on 2022-10-01
Support for packages or faces
@ -3538,7 +3807,7 @@ Changes to the manual
#+begin_src text
Modus themes version 2.6.0
By Protesilaos Stavrou <info@protesilaos.com> on 2022-08-19
By Protesilaos <info@protesilaos.com> on 2022-08-19
Changes to supported faces or face groups
@ -3651,7 +3920,7 @@ Changes to the manual
#+begin_src text
Modus themes version 2.5.0
By Protesilaos Stavrou <info@protesilaos.com> on 2022-08-03
By Protesilaos <info@protesilaos.com> on 2022-08-03
This entry documents the changes made to the project since the
publication of version 2.4.0 on 2022-06-01. It spans more than 60
@ -4078,7 +4347,7 @@ Miscellaneous
#+begin_src text
Modus themes version 2.4.0
By Protesilaos Stavrou <info@protesilaos.com> on 2022-06-01
By Protesilaos <info@protesilaos.com> on 2022-06-01
This entry documents the changes made to the project since the
publication of version 2.3.0 on 2022-04-01. It spans more than 60
@ -4417,7 +4686,7 @@ Miscellaneous
#+begin_src text
Modus themes version 2.3.0
By Protesilaos Stavrou <info@protesilaos.com> on 2022-04-01
By Protesilaos <info@protesilaos.com> on 2022-04-01
This entry documents the changes made to the project since the
publication of version 2.2.0 on 2022-02-23. It spans more than 70
@ -4483,7 +4752,7 @@ Attempted bug fix for byte compiled files
Quoting from the git log:
commit f067d2ef39c22174b95584f2cba7942aaf03bcca
Author: Protesilaos Stavrou <info@protesilaos.com>
Author: Protesilaos <info@protesilaos.com>
Date: Thu Mar 3 06:52:31 2022 +0200
Reify themes with eval-and-compile
@ -4717,7 +4986,7 @@ Thanks once again to everyone involved!
#+begin_src text
Modus themes version 2.2.0
By Protesilaos Stavrou <info@protesilaos.com> on 2022-02-23
By Protesilaos <info@protesilaos.com> on 2022-02-23
The present entry records the changes made to the project since the
publication of version 2.1.0 on 2022-02-17. This spans about 10 commits
@ -4827,7 +5096,7 @@ Miscellaneous changes
#+begin_src text
Modus themes version 2.1.0
By Protesilaos Stavrou <info@protesilaos.com> on 2022-02-17
By Protesilaos <info@protesilaos.com> on 2022-02-17
The present entry records the changes made to the project since the
publication of version 2.0.0 on 2021-12-24. There have been more than
@ -5536,7 +5805,7 @@ intense work which further iterated on an already solid base.
#+begin_src text
Modus themes version 2.0.0
By Protesilaos Stavrou <info@protesilaos.com> on 2021-12-24
By Protesilaos <info@protesilaos.com> on 2021-12-24
This entry covers the changes made to the project since the publication
of version 1.7.0 on 2021-11-18. There have been more than 90 commits in
@ -5918,7 +6187,7 @@ Miscellaneous
#+begin_src text
Modus themes version 1.7.0
By Protesilaos Stavrou <info@protesilaos.com> on 2021-11-18
By Protesilaos <info@protesilaos.com> on 2021-11-18
The present entry records the changes made to the project since the
release of version 1.6.0 on 2021-09-29. There have been more than 60
@ -6151,7 +6420,7 @@ Thanks once again to everyone involved!
#+begin_src text
Modus themes version 1.6.0
By Protesilaos Stavrou <info@protesilaos.com> on 2021-09-29
By Protesilaos <info@protesilaos.com> on 2021-09-29
This entry records the changes made to the project since the release of
version 1.5.0 on 2021-07-15. There have been around 70 commits since
@ -6504,7 +6773,7 @@ themes, version 1.6.0, as part of the next stable release of Emacs.
#+begin_src text
Modus themes version 1.5.0
By Protesilaos Stavrou <info@protesilaos.com> on 2021-07-15
By Protesilaos <info@protesilaos.com> on 2021-07-15
This entry outlines the set of changes made to the project since the
release of version 1.4.0 on 2021-05-25. There have been over 130
@ -6945,7 +7214,7 @@ Thanks again to everyone involved!
#+begin_src text
Modus themes version 1.4.0
By Protesilaos Stavrou <info@protesilaos.com> on 2021-05-25
By Protesilaos <info@protesilaos.com> on 2021-05-25
This entry records the changes made to the project since the release of
version 1.3.0 on 2021-04-17. There have been around 100 commits in the
@ -7264,7 +7533,7 @@ Miscellaneous
#+begin_src text
Modus themes version 1.3.0
By Protesilaos Stavrou <info@protesilaos.com> on 2021-04-17
By Protesilaos <info@protesilaos.com> on 2021-04-17
This entry records the changes introduced to the project since the
publication of version 1.2.0 (2021-03-04). There have been around 100
@ -7633,7 +7902,7 @@ Thanks once again to everyone involved!
#+begin_src text
Modus themes version 1.2.0
By Protesilaos Stavrou <info@protesilaos.com> on 2021-03-04
By Protesilaos <info@protesilaos.com> on 2021-03-04
This entry records the changes introduced to the project since the
publication of version 1.1.0 (2021-01-24). There have been close to 100
@ -7986,7 +8255,7 @@ Miscellaneous
#+begin_src text
Modus themes version 1.1.0
By Protesilaos Stavrou <info@protesilaos.com> on 2021-01-24
By Protesilaos <info@protesilaos.com> on 2021-01-24
This entry records the changes introduced to the project since the
publication of version 1.0.0 (2020-12-05). There have been around 150
@ -8447,7 +8716,7 @@ terms of face coverage, and (iv) meticulously designed throughout.
#+begin_src text
Modus themes version 1.0.0
By Protesilaos Stavrou <info@protesilaos.com> on 2020-12-05
By Protesilaos <info@protesilaos.com> on 2020-12-05
This entry documents the changes since version 0.13.0 (2020-10-08).
They constitute a major release with backward-incompatible additions
@ -8854,7 +9123,7 @@ it may have introduced.
#+begin_src text
Modus Operandi and Modus Vivendi version 0.13.0
By Protesilaos Stavrou <info@protesilaos.com> on 2020-10-08
By Protesilaos <info@protesilaos.com> on 2020-10-08
This entry documents the changes since version 0.12.0 (2020-08-26).
There have been around 150 commits in the meantime, making this the
@ -9385,7 +9654,7 @@ Thanks again to everyone who helped improve the themes!
#+begin_src text
Modus Operandi and Modus Vivendi version 0.12.0
By Protesilaos Stavrou <info@protesilaos.com> on 2020-08-26
By Protesilaos <info@protesilaos.com> on 2020-08-26
This entry documents the set of changes since version 0.11.0
(2020-07-31). There have been around 70 commits in the meatime, though
@ -9689,7 +9958,7 @@ their thoughts. The people already mentioned herein:
#+begin_src text
Modus Operandi and Modus Vivendi version 0.11.0
By Protesilaos Stavrou <info@protesilaos.com> on 2020-07-31
By Protesilaos <info@protesilaos.com> on 2020-07-31
This entry records the changes since version 0.10.0 (2020-06-24). The
present release covers close to 100 commits, some of which introduce
@ -9953,7 +10222,7 @@ https://gitlab.com/protesilaos/modus-themes/-/issues
#+begin_src text
Modus Operandi and Modus Vivendi version 0.10.0
By Protesilaos Stavrou <info@protesilaos.com> on 2020-06-24
By Protesilaos <info@protesilaos.com> on 2020-06-24
This entry records the changes since version 0.9.0 (2020-06-03). The
present release is focused on stability and internal improvements.
@ -10075,7 +10344,7 @@ My thanks to Basil and André for their contributions!
#+begin_src text
Modus Operandi and Modus Vivendi version 0.9.0
By Protesilaos Stavrou <info@protesilaos.com> on 2020-06-03
By Protesilaos <info@protesilaos.com> on 2020-06-03
This entry records the changes since version 0.8.0 (2020-04-28). The
present release contains about 50 commits, covering a month of active
@ -10233,7 +10502,7 @@ Added support for
#+begin_src text
Modus Operandi and Modus Vivendi version 0.8.0
By Protesilaos Stavrou <info@protesilaos.com> on 2020-04-28
By Protesilaos <info@protesilaos.com> on 2020-04-28
This entry records the changes since version 0.7.0 (2020-03-30). The
present release contains a little more than a hundred commits, covering
@ -10407,7 +10676,7 @@ Miscellaneous changes and concluding remarks
#+begin_src text
Modus Operandi and Modus Vivendi version 0.7.0
By Protesilaos Stavrou <info@protesilaos.com> on 2020-03-30
By Protesilaos <info@protesilaos.com> on 2020-03-30
This entry documents the changes since version 0.6.0 (2020-03-01). The
present release is the largest to date containing 110 commits.

View file

@ -67,7 +67,8 @@ The manual has a section about building on top of Modus. My
("C-<f5>" . modus-themes-select)
("M-<f5>" . modus-themes-load-random))
:config
;; Your customizations here:
;; 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
@ -88,3 +89,49 @@ The manual has a section about building on top of Modus. My
;; `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
@ -90,4 +90,6 @@ standard)."
'modus-operandi-deuteranopia-palette-overrides
'modus-themes-faces-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
@ -87,4 +87,6 @@ which corresponds to a minimum contrast in relative luminance of
'modus-operandi-palette-user
'modus-operandi-palette-overrides)
(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
@ -87,4 +87,6 @@ which corresponds to a minimum contrast in relative luminance of
'modus-operandi-tinted-palette-user
'modus-operandi-tinted-palette-overrides)
(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
@ -90,4 +90,6 @@ standard)."
'modus-operandi-tritanopia-palette-overrides
'modus-themes-faces-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
@ -90,4 +90,6 @@ standard)."
'modus-vivendi-deuteranopia-palette-overrides
'modus-themes-faces-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
@ -87,4 +87,6 @@ which corresponds to a minimum contrast in relative luminance of
'modus-vivendi-palette-user
'modus-vivendi-palette-overrides)
(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
@ -87,4 +87,6 @@ which corresponds to a minimum contrast in relative luminance of
'modus-vivendi-tinted-palette-user
'modus-vivendi-tinted-palette-overrides)
(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
@ -90,4 +90,6 @@ standard)."
'modus-vivendi-tritanopia-palette-overrides
'modus-themes-faces-tritanopia)
(provide 'modus-vivendi-tritanopia-theme)
;;; modus-vivendi-tritanopia-theme.el ends here

View file

@ -1,10 +1,10 @@
;;; modus-themes-test.el --- Unit tests for the Modus themes -*- lexical-binding: t -*-
;; Copyright (C) 2025 Free Software Foundation, Inc.
;; Copyright (C) 2025-2026 Free Software Foundation, Inc.
;; Author: Rudolf Adamkovič <rudolf@adamkovic.org>,
;; Protesilaos Stavrou <info@protesilaos.com>
;; Maintainer: Protesilaos Stavrou <info@protesilaos.com>
;; 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.
@ -35,20 +35,334 @@
(require 'ert)
(require 'modus-themes)
(ert-deftest mtt-inheritance ()
(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)
(modus-themes-select '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))))
(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