emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/autothemer 8ec0c27a73 19/21: Add color palette export/re-u


From: ELPA Syncer
Subject: [nongnu] elpa/autothemer 8ec0c27a73 19/21: Add color palette export/re-use example
Date: Thu, 6 Jan 2022 02:58:10 -0500 (EST)

branch: elpa/autothemer
commit 8ec0c27a73b2d0a335eda63fde695a101e2956b2
Author: diego <9020453+dieggsy@users.noreply.github.com>
Commit: Jason Milkins <jasonm23@users.noreply.github.com>

    Add color palette export/re-use example
---
 readme.md | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/readme.md b/readme.md
index 71cd42ad4e..aa390b6369 100644
--- a/readme.md
+++ b/readme.md
@@ -162,6 +162,22 @@ We recommend thoroughly reviewing the auto generated 
themes so that
 you produce a high quality theme.  Autothemer doesn't replace good
 judgement and taste!
 
+### Re-using the color palette
+
+While autothemer doesn't export the defined color variables for external
+use, you can define simple advice on `autothemer-deftheme` to do so:
+
+```emacs-lisp
+(define-advice autothemer-deftheme (:before (_ _ palette &rest _) defcolors)
+  (mapcar (lambda (e)
+            (setf (symbol-value (car e))
+                  (cadr e)))
+          (cdr palette)))
+```
+If you place the advice definition before the autothemer-generated theme
+is loaded, e.g. `my-red` from the example above will be available as a 
+variable that can be used in other parts of your emacs configuration.
+
 ### Themes using Autothemer
 
 - [Darktooth](https://github.com/emacsfodder/emacs-theme-darktooth)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]