]> git.eshelyaron.com Git - emacs.git/commitdiff
Replace vtable--color-blend with color-blend
authorJoseph Turner <joseph@breatheoutbreathe.in>
Sat, 2 Nov 2024 05:21:34 +0000 (22:21 -0700)
committerEshel Yaron <me@eshelyaron.com>
Sat, 9 Nov 2024 15:49:47 +0000 (16:49 +0100)
* lisp/emacs-lisp/vtable.el (vtable--face-color): Use `color-blend'.
(vtable--color-blend): Remove unused function.

(cherry picked from commit fdab542a56201b1581abdc0df940e0c50abde1c7)

lisp/emacs-lisp/vtable.el

index 3e389409e299026779b7cee9eb92d47067a79c24..5b64a98d7bf242298098b187ff582e4f87668a98 100644 (file)
@@ -213,18 +213,12 @@ See info node `(vtable)Top' for vtable documentation."
                   (funcall accessor face2)
                 (plist-get face2 slot))))
     (if (and col1 col2)
-        (vtable--color-blend col1 col2)
+        (apply #'color-rgb-to-hex
+               `(,@(color-blend (color-name-to-rgb col1)
+                                (color-name-to-rgb col2))
+                 2))
       (or col1 col2))))
 
-;;; FIXME: This is probably not the right way to blend two colors, is
-;;; it?
-(defun vtable--color-blend (color1 color2)
-  (cl-destructuring-bind (r g b)
-      (mapcar (lambda (n) (* (/ n 2) 255.0))
-              (cl-mapcar #'+ (color-name-to-rgb color1)
-                         (color-name-to-rgb color2)))
-    (format "#%02X%02X%02X" r g b)))
-
 ;;; Interface utility functions.
 
 (defun vtable-current-table ()