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

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

[nongnu] elpa/alect-themes 83d15bd 016/269: Add function for modifying c


From: ELPA Syncer
Subject: [nongnu] elpa/alect-themes 83d15bd 016/269: Add function for modifying color palettes
Date: Thu, 21 Oct 2021 17:58:40 -0400 (EDT)

branch: elpa/alect-themes
commit 83d15bdc83f7fd0fc58f5dd7460264e34acf226b
Author: Alex Kost <alezost@gmail.com>
Commit: Alex Kost <alezost@gmail.com>

    Add function for modifying color palettes
---
 alect-themes.el | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/alect-themes.el b/alect-themes.el
index 5dbc0ba..be30fdd 100644
--- a/alect-themes.el
+++ b/alect-themes.el
@@ -143,6 +143,18 @@ color names (symbols) and values (strings)."
   ;;                      (alist :key-type symbol :value-type string)))
   :group 'alect)
 
+(defun alect-set-color (theme-name color-name color-val)
+  "Set color COLOR-NAME of a theme THEME-NAME to the value of COLOR-VAL.
+COLOR-NAME and THEME-NAME are symbols, COLOR-VAL is a string.
+See `alect-colors' for details."
+  (let ((color-alist (cdr (assoc theme-name alect-colors))))
+    (or color-alist
+        (error "Theme '%s' does not exist" theme-name))
+    (let ((color-cons (assoc color-name color-alist)))
+      (or color-cons
+          (error "Color '%s' does not exist" color-name))
+      (setcdr color-cons color-val))))
+
 (defun alect-get-color (theme-name color-name)
   "Return the value of color for the specified theme."
   (cdr (assoc color-name



reply via email to

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