diff options
| author | Eli Zaretskii | 2024-11-09 12:45:14 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2024-11-09 12:45:14 +0200 |
| commit | 17f4f2dec95d93eae3aaf3c6e4c59955732f8f62 (patch) | |
| tree | c2f3e0caa4d318df6b08098c37109f5d7e0312ca | |
| parent | fdab542a56201b1581abdc0df940e0c50abde1c7 (diff) | |
| download | emacs-17f4f2dec95d93eae3aaf3c6e4c59955732f8f62.tar.gz emacs-17f4f2dec95d93eae3aaf3c6e4c59955732f8f62.zip | |
; Fix last changes
* lisp/color.el (color-blend): Fix quoting of apostrophe.
(color-rgb-to-hex, color-blend): Autoload.
| -rw-r--r-- | lisp/color.el | 4 |
1 files changed, 3 insertions, 1 deletions
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." | |||
| 55 | (let ((valmax (float (car (color-values "#ffffffffffff"))))) | 55 | (let ((valmax (float (car (color-values "#ffffffffffff"))))) |
| 56 | (mapcar (lambda (x) (/ x valmax)) (color-values color frame)))) | 56 | (mapcar (lambda (x) (/ x valmax)) (color-values color frame)))) |
| 57 | 57 | ||
| 58 | ;;;###autoload | ||
| 58 | (defun color-rgb-to-hex (red green blue &optional digits-per-component) | 59 | (defun color-rgb-to-hex (red green blue &optional digits-per-component) |
| 59 | "Return hexadecimal #RGB notation for the color specified by RED GREEN BLUE. | 60 | "Return hexadecimal #RGB notation for the color specified by RED GREEN BLUE. |
| 60 | RED, GREEN, and BLUE should be numbers between 0.0 and 1.0, inclusive. | 61 | RED, GREEN, and BLUE should be numbers between 0.0 and 1.0, inclusive. |
| @@ -75,6 +76,7 @@ components (e.g. \"#ffff1212ecec\")." | |||
| 75 | (- 1.0 (nth 1 color)) | 76 | (- 1.0 (nth 1 color)) |
| 76 | (- 1.0 (nth 2 color))))) | 77 | (- 1.0 (nth 2 color))))) |
| 77 | 78 | ||
| 79 | ;;;###autoload | ||
| 78 | (defun color-blend (a b &optional alpha) | 80 | (defun color-blend (a b &optional alpha) |
| 79 | "Blend the two colors A and B in linear space with ALPHA. | 81 | "Blend the two colors A and B in linear space with ALPHA. |
| 80 | A and B should be lists (RED GREEN BLUE), where each element is | 82 | 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. | |||
| 83 | 85 | ||
| 84 | For instance: | 86 | For instance: |
| 85 | 87 | ||
| 86 | (color-blend '(1 0.5 1) '(0 0 0) 0.75) | 88 | (color-blend \\='(1 0.5 1) \\='(0 0 0) 0.75) |
| 87 | => (0.75 0.375 0.75)" | 89 | => (0.75 0.375 0.75)" |
| 88 | (setq alpha (or alpha 0.5)) | 90 | (setq alpha (or alpha 0.5)) |
| 89 | (let (blend) | 91 | (let (blend) |