From: Eli Zaretskii Date: Sat, 9 Nov 2024 10:45:14 +0000 (+0200) Subject: ; Fix last changes X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=148a6b9bb9157bbe41cb3027e39b10a825d22e1a;p=emacs.git ; Fix last changes * lisp/color.el (color-blend): Fix quoting of apostrophe. (color-rgb-to-hex, color-blend): Autoload. (cherry picked from commit 17f4f2dec95d93eae3aaf3c6e4c59955732f8f62) --- diff --git a/lisp/color.el b/lisp/color.el index 30e041c60a7..cdeaa97ee64 100644 --- a/lisp/color.el +++ b/lisp/color.el @@ -55,6 +55,7 @@ If FRAME cannot display COLOR, return nil." (let ((valmax (float (car (color-values "#ffffffffffff"))))) (mapcar (lambda (x) (/ x valmax)) (color-values color frame)))) +;;;###autoload (defun color-rgb-to-hex (red green blue &optional digits-per-component) "Return hexadecimal #RGB notation for the color specified by RED GREEN BLUE. RED, GREEN, and BLUE should be numbers between 0.0 and 1.0, inclusive. @@ -75,6 +76,7 @@ components (e.g. \"#ffff1212ecec\")." (- 1.0 (nth 1 color)) (- 1.0 (nth 2 color))))) +;;;###autoload (defun color-blend (a b &optional alpha) "Blend the two colors A and B in linear space with ALPHA. A and B should be lists (RED GREEN BLUE), where each element is @@ -83,7 +85,7 @@ has on the result and should be between 0.0 and 1.0, inclusive. For instance: - (color-blend '(1 0.5 1) '(0 0 0) 0.75) + (color-blend \\='(1 0.5 1) \\='(0 0 0) 0.75) => (0.75 0.375 0.75)" (setq alpha (or alpha 0.5)) (let (blend)