Previous: , Up: Customization options [Index]


4.13 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:

Examples demonstrating how to use the aforementioned:

;;; Common customizations
;; Define two new colors in the common "user" palette of all the Modus themes.
(setq modus-themes-common-palette-user
 '((cherry "#a0134f")
 (plum "#6f459a")))
;; Use them in the overrides.
(setq modus-themes-common-palette-overrides
 '((cursor cherry)
 (string plum)))
;;; Per-theme customizations
;; Define two new colors in the "user" palette of `modus-operandi'.
;; Other themes will not use these.
(setq modus-operandi-palette-user
 '((cherry "#a0134f")
 (plum "#6f459a")))
;; Use them in the overrides.
(setq modus-operandi-palette-overrides
 '((cursor cherry)
 (string plum)))
;; Tweaks on a per-theme basis give the user maximum flexibility. For
;; example, they can have the above for `modus-operandi' while they use
;; these for `modus-vivendi':
(setq modus-vivendi-palette-user
 '((apricot "#dfb350")
 (kiwi "#80d458")))
(setq modus-vivendi-palette-overrides
 '((cursor apricot)
 (string kiwi)))

Previous: Option for palette overrides, Up: Customization options [Index]

AltStyle によって変換されたページ (->オリジナル) /