DIY Make completion matches more or less colorful
This section contains practical examples of overriding the palette of the themes (Option for palette overrides). Here we demonstrate how to activate background coloration for completion matches. We show three different degrees of intensity.
Option for completion framework aesthetics.
emacs-lisp
;; Add a nuanced background color to completion matches, while keeping
;; their foreground intact (foregrounds do not need to be specified in
;; this case, but we do it for didactic purposes).
(setq modus-themes-common-palette-overrides
'((fg-completion-match-0 blue)
(fg-completion-match-1 magenta-warmer)
(fg-completion-match-2 cyan)
(fg-completion-match-3 red)
(bg-completion-match-0 bg-blue-nuanced)
(bg-completion-match-1 bg-magenta-nuanced)
(bg-completion-match-2 bg-cyan-nuanced)
(bg-completion-match-3 bg-red-nuanced)))
;; Add intense background colors to completion matches and adjust the
;; foregrounds accordingly.
(setq modus-themes-common-palette-overrides
'((fg-completion-match-0 fg-main)
(fg-completion-match-1 fg-main)
(fg-completion-match-2 fg-main)
(fg-completion-match-3 fg-main)
(bg-completion-match-0 bg-blue-intense)
(bg-completion-match-1 bg-yellow-intense)
(bg-completion-match-2 bg-cyan-intense)
(bg-completion-match-3 bg-red-intense)))
;; Like the above, but with subtle backgrounds.
(setq modus-themes-common-palette-overrides
'((fg-completion-match-0 fg-main)
(fg-completion-match-1 fg-main)
(fg-completion-match-2 fg-main)
(fg-completion-match-3 fg-main)
(bg-completion-match-0 bg-blue-subtle)
(bg-completion-match-1 bg-yellow-subtle)
(bg-completion-match-2 bg-cyan-subtle)
(bg-completion-match-3 bg-red-subtle)))Adding to the above, it is possible to, say, reduce the number of colors to two:
emacs-lisp
;; No backgrounds (like the default) and just use two colors.
(setq modus-themes-common-palette-overrides
'((fg-completion-match-0 blue)
(fg-completion-match-1 yellow)
(fg-completion-match-2 blue)
(fg-completion-match-3 yellow)
(bg-completion-match-0 unspecified)
(bg-completion-match-1 unspecified)
(bg-completion-match-2 unspecified)
(bg-completion-match-3 unspecified)))
;; Again, a two-color style but this time with backgrounds
(setq modus-themes-common-palette-overrides
'((fg-completion-match-0 blue)
(fg-completion-match-1 yellow)
(fg-completion-match-2 blue)
(fg-completion-match-3 yellow)
(bg-completion-match-0 bg-blue-nuanced)
(bg-completion-match-1 bg-yellow-nuanced)
(bg-completion-match-2 bg-blue-nuanced)
(bg-completion-match-3 bg-yellow-nuanced)))The user can mix and match to their liking.
Reload the theme for changes to take effect.