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

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

[nongnu] elpa/eglot-inactive-regions 21c26bc4e2 40/66: use built-in colo


From: ELPA Syncer
Subject: [nongnu] elpa/eglot-inactive-regions 21c26bc4e2 40/66: use built-in color to hex converter
Date: Fri, 6 Dec 2024 06:59:55 -0500 (EST)

branch: elpa/eglot-inactive-regions
commit 21c26bc4e2a4c9dc9df397982ec0581eebfac7a2
Author: Filippo Argiolas <filippo.argiolas@gmail.com>
Commit: Filippo Argiolas <filippo.argiolas@gmail.com>

    use built-in color to hex converter
---
 clangd-inactive-regions.el | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/clangd-inactive-regions.el b/clangd-inactive-regions.el
index a4a5256521..17132037de 100644
--- a/clangd-inactive-regions.el
+++ b/clangd-inactive-regions.el
@@ -114,12 +114,11 @@ factor."
   (let ((from-rgb (color-name-to-rgb from-color))
         (to-rgb (color-name-to-rgb to-color))
         (alpha (min 1.0 (max 0.0 alpha))))
-    (apply 'format
-           "#%02x%02x%02x"
-           (cl-mapcar #'(lambda (a b)
-                          (truncate (* 255 (+ (* a alpha)
-                                              (* b (- 1.0 alpha))))))
-                      from-rgb to-rgb))))
+    (if (and from-rgb to-rgb)
+      (apply 'color-rgb-to-hex
+             (cl-mapcar #'(lambda (a b) (+ (* a alpha) (* b (- 1.0 alpha))))
+                        from-rgb to-rgb))
+      'unspecified)))
 
 (defun clangd-inactive-regions-cleanup ()
   "Clean up inactive regions."



reply via email to

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