mirror of
https://github.com/protesilaos/modus-themes.git
synced 2026-09-10 07:16:30 -04:00
Add utilities for DIY users
Basically this defines the 'modus-themes-color' function that lets you
retrieve the colour value assigned to KEY. The key is found in the
association list that contains each theme's colour palette.
Example for how to use this:
(set-face-attribute 'cursor nil :background (modus-themes-color 'blue))
Ongoing discussion in the Modus themes' main repo:
https://gitlab.com/protesilaos/modus-themes/-/issues/119
This commit is contained in:
parent
e00a59a2c8
commit
3f97a3f153
|
|
@ -1307,6 +1307,26 @@ symbol and the latter as a string.")
|
|||
|
||||
(make-obsolete 'modus-vivendi-theme-override-colors-alist nil "1.0.0")
|
||||
|
||||
|
||||
|
||||
;;;; Utilities for DIY users
|
||||
|
||||
(defun modus-themes--active-theme ()
|
||||
"Return appropriate alist of color values for active theme."
|
||||
(let ((theme (car custom-enabled-themes)))
|
||||
(pcase theme
|
||||
('modus-operandi modus-themes-operandi-colors)
|
||||
('modus-vivendi modus-themes-vivendi-colors)
|
||||
(_ (user-error "'%s' not a Modus theme; check `custom-enabled-themes'" theme)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun modus-themes-color (key)
|
||||
"Return color value for KEY."
|
||||
(let ((alist (modus-themes--active-theme)))
|
||||
(cdr (assoc `,key alist))))
|
||||
|
||||
|
||||
|
||||
;;;; Face specifications
|
||||
|
||||
(defvar modus-themes
|
||||
|
|
|
|||
Loading…
Reference in a new issue