diff options
| author | Mark Oteiza | 2017-09-13 09:59:37 -0400 |
|---|---|---|
| committer | Mark Oteiza | 2017-09-13 09:59:37 -0400 |
| commit | 8d433d9b22d2c5f209cb27e80c13576e6d1bf9b7 (patch) | |
| tree | b8841fcb75959eff564ba146b7fa9db137791a16 | |
| parent | 61b8f9c4903734ae5a019b1f8e7706287aeb0f9d (diff) | |
| download | emacs-8d433d9b22d2c5f209cb27e80c13576e6d1bf9b7.tar.gz emacs-8d433d9b22d2c5f209cb27e80c13576e6d1bf9b7.zip | |
Permit non-integral color gradients
* lisp/color.el (color-gradient): Float the step-number.
| -rw-r--r-- | lisp/color.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/color.el b/lisp/color.el index 6dbf3d55cbc..ddd0fdb15ab 100644 --- a/lisp/color.el +++ b/lisp/color.el | |||
| @@ -82,9 +82,10 @@ resulting list." | |||
| 82 | (let* ((r (nth 0 start)) | 82 | (let* ((r (nth 0 start)) |
| 83 | (g (nth 1 start)) | 83 | (g (nth 1 start)) |
| 84 | (b (nth 2 start)) | 84 | (b (nth 2 start)) |
| 85 | (r-step (/ (- (nth 0 stop) r) (1+ step-number))) | 85 | (interval (float (1+ step-number))) |
| 86 | (g-step (/ (- (nth 1 stop) g) (1+ step-number))) | 86 | (r-step (/ (- (nth 0 stop) r) interval)) |
| 87 | (b-step (/ (- (nth 2 stop) b) (1+ step-number))) | 87 | (g-step (/ (- (nth 1 stop) g) interval)) |
| 88 | (b-step (/ (- (nth 2 stop) b) interval)) | ||
| 88 | result) | 89 | result) |
| 89 | (dotimes (_ step-number) | 90 | (dotimes (_ step-number) |
| 90 | (push (list (setq r (+ r r-step)) | 91 | (push (list (setq r (+ r r-step)) |