From f1a4746135951d3dbdf822b67e6831ec40da2d4d Mon Sep 17 00:00:00 2001 From: Paul Provost Date: Thu, 27 Feb 2020 07:24:52 -0500 Subject: [PATCH] Reverted technique from zenburn Uses self-generating code, which is difficult to read and debug. --- petrol-theme.el | 51 +++++++++++++++++-------------------------------- 1 file changed, 18 insertions(+), 33 deletions(-) diff --git a/petrol-theme.el b/petrol-theme.el index 60b5b3a..eb0057f 100644 --- a/petrol-theme.el +++ b/petrol-theme.el @@ -45,42 +45,27 @@ (deftheme petrol "Petrol light color theme.") -;;,-------------- -;;| Color Palette -;;`-------------- +(let* ((class '((class color) (min-colors 89))) -(defvar petrol-colors-alist - '( - ("petrol-fg" . "#454545") - ("petrol-bg" . "#f6f6ed") - ("petrol-blue" . "#006c96") - ("petrol-orange" . "#cc6d00") - ("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. -Also bind `class' to ((class color) (min-colors 89))." - (declare (indent 0)) - `(let* ((class '((class color) (min-colors 89))) - ,@(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 + ;;,----------------- + ;;| Generic colors. + ;;`----------------- + (petrol-fg "#454545") + (petrol-bg "#f6f6ed") + (petrol-blue "#006c96") + (petrol-orange "#cc6d00") + (petrol-purple "#6c4ca8") + (petrol-red "#d0372d") + + ;;,------------------ + ;;| Specific colors. + ;;`------------------ + (petrol-link `(:weight normal :foreground ,petrol-blue)) + (petrol-link-visited `(:weight normal :foreground ,petrol-purple)) + ) (custom-theme-set-faces 'petrol - `(default ((,class (:background "#f6f6ed" :foreground "#454545")))) + `(default ((,class (:background ,petrol-bg :foreground ,petrol-fg)))) `(cursor ((,class (:background "#00638a" :foreground "#f2f2f2" ))))