summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorJoseph Turner <joseph@breatheoutbreathe.in>2024-11-01 22:21:34 -0700
committerEli Zaretskii <eliz@gnu.org>2024-11-09 12:40:56 +0200
commitfdab542a56201b1581abdc0df940e0c50abde1c7 (patch)
tree6604d66219e6c27ec4616e64e6e80f73a02dd274 /lisp/emacs-lisp
parentbf312529def48bc6fdf72d43d5be158d125f52f6 (diff)
downloademacs-fdab542a56201b1581abdc0df940e0c50abde1c7.tar.gz
emacs-fdab542a56201b1581abdc0df940e0c50abde1c7.tar.bz2
emacs-fdab542a56201b1581abdc0df940e0c50abde1c7.zip
Replace vtable--color-blend with color-blend
* lisp/emacs-lisp/vtable.el (vtable--face-color): Use `color-blend'. (vtable--color-blend): Remove unused function.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/vtable.el14
1 files changed, 4 insertions, 10 deletions
diff --git a/lisp/emacs-lisp/vtable.el b/lisp/emacs-lisp/vtable.el
index a839f3d70b8..c4f14d7b4b2 100644
--- a/lisp/emacs-lisp/vtable.el
+++ b/lisp/emacs-lisp/vtable.el
@@ -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 ()