Reverted technique from zenburn

Uses self-generating code, which is difficult to read and debug.
This commit is contained in:
Paul Provost 2020-02-27 07:24:52 -05:00
parent 589a48ba6c
commit f1a4746135

View File

@ -45,42 +45,27 @@
(deftheme petrol (deftheme petrol
"Petrol light color theme.") "Petrol light color theme.")
;;,-------------- (let* ((class '((class color) (min-colors 89)))
;;| Color Palette
;;`--------------
(defvar petrol-colors-alist ;;,-----------------
'( ;;| Generic colors.
("petrol-fg" . "#454545") ;;`-----------------
("petrol-bg" . "#f6f6ed") (petrol-fg "#454545")
("petrol-blue" . "#006c96") (petrol-bg "#f6f6ed")
("petrol-orange" . "#cc6d00") (petrol-blue "#006c96")
("petrol-purple" . "#6c4ca8") (petrol-orange "#cc6d00")
("petrol-red" . "#d0372d") (petrol-purple "#6c4ca8")
) (petrol-red "#d0372d")
"List of Petrol colors.
Each element has the form (NAME . HEX).
`+N' suffixes indicate a color is lighter.
`-N' suffixes indicate a color is darker.")
(defmacro petrol-with-color-variables (&rest body) ;;,------------------
"`let' bind all colors defined in `petrol-colors-alist' around BODY. ;;| Specific colors.
Also bind `class' to ((class color) (min-colors 89))." ;;`------------------
(declare (indent 0)) (petrol-link `(:weight normal :foreground ,petrol-blue))
`(let* ((class '((class color) (min-colors 89))) (petrol-link-visited `(:weight normal :foreground ,petrol-purple))
,@(mapcar (lambda (cons) )
(list (intern (car cons)) (cdr cons)))
petrol-colors-alist
)
(petrol-link `(:weight normal :foreground ,petrol-blue))
(petrol-link-visited `(:weight normal :foreground ,petrol-purple))
)
,@body))
(petrol-with-color-variables
(custom-theme-set-faces (custom-theme-set-faces
'petrol 'petrol
`(default ((,class (:background "#f6f6ed" :foreground "#454545")))) `(default ((,class (:background ,petrol-bg :foreground ,petrol-fg))))
`(cursor ((,class (:background "#00638a" :foreground "#f2f2f2" )))) `(cursor ((,class (:background "#00638a" :foreground "#f2f2f2" ))))