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

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

[nongnu] elpa/autothemer cd4724173d 03/21: Bugfix: ignore colors that ar


From: ELPA Syncer
Subject: [nongnu] elpa/autothemer cd4724173d 03/21: Bugfix: ignore colors that are not color-defined-p
Date: Thu, 6 Jan 2022 02:58:05 -0500 (EST)

branch: elpa/autothemer
commit cd4724173d8a1f34a4bf0c98622d8a0c765eb7d4
Author: Sebastian Sturm <sturm@itp.uni-leipzig.de>
Commit: Sebastian Sturm <sturm@itp.uni-leipzig.de>

    Bugfix: ignore colors that are not color-defined-p
    
    otherwise, color specifications such as "color-237" would yield a
    distance of 0 and shadow all the reasonable palette entries
---
 autothemer.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/autothemer.el b/autothemer.el
index 9f010ad2a7..ee6a7f124c 100644
--- a/autothemer.el
+++ b/autothemer.el
@@ -106,10 +106,11 @@ of `autothemer--color' structs."
   (let ((mindistance 0)
         (closest-color nil))
     (mapc (lambda (candidate)
-            (let ((distance (autothemer--color-distance color candidate)))
-              (if (or (not closest-color) (< distance mindistance))
-                  (setq closest-color candidate
-                        mindistance distance))))
+            (when (color-defined-p (autothemer--color-value candidate))
+              (let ((distance (autothemer--color-distance color candidate)))
+                (if (or (not closest-color) (< distance mindistance))
+                    (setq closest-color candidate
+                          mindistance distance)))))
           colors)
     closest-color))
 



reply via email to

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