From 940d1951548537e07a1fe0ec0acb1858b0af8533 Mon Sep 17 00:00:00 2001 From: Joseph Turner Date: Fri, 1 Nov 2024 22:21:34 -0700 Subject: [PATCH 2/2] Replace vtable--color-blend with color-blend * lisp/emacs-lisp/vtable.el (vtable--face-color): Use `color-blend'. (vtable--color-blend): Remove unused function. --- lisp/emacs-lisp/vtable.el | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lisp/emacs-lisp/vtable.el b/lisp/emacs-lisp/vtable.el index 925961f012c..47eb6e1a7b5 100644 --- a/lisp/emacs-lisp/vtable.el +++ b/lisp/emacs-lisp/vtable.el @@ -212,18 +212,12 @@ vtable--face-color (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 () -- 2.46.0