The theme modus-vivendi
exports an alist of named colors:
(deftheme modus-vivendi
"Elegant, highly legible and customizable dark theme.
Conforms with the highest legibility standard for color contrast
between background and foreground in any given piece of text,
which corresponds to a minimum contrast in relative luminance of
7:1 (WCAG AAA standard).")
(defconst modus-vivendi-palette
'(
;;; Basic values
(bg-main "#000000")
(bg-dim "#1e1e1e")
(fg-main "#ffffff")
(fg-dim "#989898")
(fg-alt "#c6daff")
...
I am trying to access these colors by name so that I can use them in some face specifications. Here is the working code that I came up with:
(let-alist modus-vivendi-palette
(let ((code-bg (car .bg-blue-nuanced)))
(custom-set-faces
`(org-block-begin-line ((t (:background ,code-bg :extend t))))
`(org-block-end-line ((t (:background ,code-bg :extend t))))
`(org-block ((t (:background ,code-bg :extend t))))
)))
I am a new Lisp programmer who is used to languages such as Python, Java and JavaScript. This solution feels wrong to me because it requires a lot of work just to get some data from the equivalent of a Python dictionary. Is there a better way to implement this code, or is this considered idiomatic?