[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ef-themes 2c490830ea 249/281: Implement ef-themes-with-
From: |
ELPA Syncer |
Subject: |
[elpa] externals/ef-themes 2c490830ea 249/281: Implement ef-themes-with-colors macro |
Date: |
Tue, 16 Aug 2022 16:58:38 -0400 (EDT) |
branch: externals/ef-themes
commit 2c490830ea9b8900cb8e330cba173c3780affa85
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Implement ef-themes-with-colors macro
---
ef-themes.el | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/ef-themes.el b/ef-themes.el
index 3b1dd81ca2..869a493ec3 100644
--- a/ef-themes.el
+++ b/ef-themes.el
@@ -944,5 +944,27 @@ Those are stored in `ef-themes-faces' and
(unless (equal dir (expand-file-name "themes/" data-directory))
(add-to-list 'custom-theme-load-path dir))))
+;;; Use theme colors
+
+(defmacro ef-themes-with-colors (&rest body)
+ "Evaluate BODY with colors from current palette bound."
+ (declare (indent 0))
+ (let* ((sym (gensym))
+ (palette (intern
+ (format "%s-palette"
+ (car (ef-themes--list-enabled-themes)))))
+ (colors (mapcar #'car (symbol-value palette))))
+ `(let* ((c '((class color) (min-colors 256)))
+ (,sym ,palette)
+ ,@(mapcar (lambda (color)
+ (list color
+ `(let* ((value (car (alist-get ',color ,sym))))
+ (if (stringp value)
+ value
+ (car (alist-get value ,sym))))))
+ colors))
+ (ignore c ,@colors) ; Silence unused variable warnings
+ ,@body)))
+
(provide 'ef-themes)
;;; ef-themes.el ends here
- [elpa] externals/ef-themes 8986b3bf4b 271/281: Remove demo screenshots (preparing a package), (continued)
- [elpa] externals/ef-themes 8986b3bf4b 271/281: Remove demo screenshots (preparing a package), ELPA Syncer, 2022/08/16
- [elpa] externals/ef-themes d7f7e4208e 263/281: ef-winter: tweak mail-0 mapping, ELPA Syncer, 2022/08/16
- [elpa] externals/ef-themes e86757c1ee 252/281: Fix :inherit of mu4e-footer-face, ELPA Syncer, 2022/08/16
- [elpa] externals/ef-themes 3ac18556f6 268/281: ef-winter: refashion the theme, ELPA Syncer, 2022/08/16
- [elpa] externals/ef-themes c58d08befd 242/281: ef-summer: tweak bg-info, ELPA Syncer, 2022/08/16
- [elpa] externals/ef-themes 862a358924 258/281: ef-winter: tweak bg-yellow, ELPA Syncer, 2022/08/16
- [elpa] externals/ef-themes 63d90c6698 259/281: ef-winter: tweak bg-red, ELPA Syncer, 2022/08/16
- [elpa] externals/ef-themes 06d385e3d0 145/281: ef-night: refine info and err backgrounds, ELPA Syncer, 2022/08/16
- [elpa] externals/ef-themes e8fc62ee35 149/281: ef-night: refine blue-warmer, magenta-cooler, ELPA Syncer, 2022/08/16
- [elpa] externals/ef-themes 30ad91cff6 172/281: ef-spring: tweak red-faint, yellow-faint, ELPA Syncer, 2022/08/16
- [elpa] externals/ef-themes 2c490830ea 249/281: Implement ef-themes-with-colors macro,
ELPA Syncer <=
- [elpa] externals/ef-themes 6cf9f27a26 269/281: Update ef-winter contrast table (per 3ac1855), ELPA Syncer, 2022/08/16
- [elpa] externals/ef-themes ef4b2ec098 246/281: Tweak dired-mark foreground, ELPA Syncer, 2022/08/16
- [elpa] externals/ef-themes e8f7a8adca 250/281: Reorder code that adds themes to path, ELPA Syncer, 2022/08/16
- [elpa] externals/ef-themes 8448e1fc16 254/281: Move helper function further up in the outline, ELPA Syncer, 2022/08/16