Option to extend the palette
It is possible to extend the palette of each theme. For example, the user may define their own ‘cherry’ color with a value of ‘#a0134f’ and then apply it as an override (Option for palette overrides). Those colors may also be used in custom code that leverages either the modus-themes-with-colors macro or the function modus-themes-get-color-value.
The palette extension can be done in the form of a common set of definitions that are shared among the themes or on a per-theme basis.
The common values are stored in the user option modus-themes-common-palette-user. As for per-theme variables, we have the following user options:
modus-operandi-palette-user
modus-operandi-tinted-palette-user
modus-operandi-deuteranopia-palette-user
modus-operandi-tritanopia-palette-user
modus-vivendi-palette-user
modus-vivendi-tinted-palette-user
modus-vivendi-deuteranopia-palette-user
modus-vivendi-tritanopia-palette-user
Examples demonstrating how to use the aforementioned:
emacs-lisp
;;; Common customizations
;; Define two new colors in the common "user" palette of all the Modus themes.
(setq modus-themes-common-palette-user
'((cherry "#a0134f")
(plum "#6f459a")))
;; Use them in the overrides.
(setq modus-themes-common-palette-overrides
'((cursor cherry)
(string plum)))
;;; Per-theme customizations
;; Define two new colors in the "user" palette of `modus-operandi'.
;; Other themes will not use these.
(setq modus-operandi-palette-user
'((cherry "#a0134f")
(plum "#6f459a")))
;; Use them in the overrides.
(setq modus-operandi-palette-overrides
'((cursor cherry)
(string plum)))
;; Tweaks on a per-theme basis give the user maximum flexibility. For
;; example, they can have the above for `modus-operandi' while they use
;; these for `modus-vivendi':
(setq modus-vivendi-palette-user
'((apricot "#dfb350")
(kiwi "#80d458")))
(setq modus-vivendi-palette-overrides
'((cursor apricot)
(string kiwi)))