From 8d433d9b22d2c5f209cb27e80c13576e6d1bf9b7 Mon Sep 17 00:00:00 2001 From: Mark Oteiza Date: Wed, 13 Sep 2017 09:59:37 -0400 Subject: [PATCH] Permit non-integral color gradients * lisp/color.el (color-gradient): Float the step-number. --- lisp/color.el | 7 ++++--- 1 file 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." (let* ((r (nth 0 start)) (g (nth 1 start)) (b (nth 2 start)) - (r-step (/ (- (nth 0 stop) r) (1+ step-number))) - (g-step (/ (- (nth 1 stop) g) (1+ step-number))) - (b-step (/ (- (nth 2 stop) b) (1+ step-number))) + (interval (float (1+ step-number))) + (r-step (/ (- (nth 0 stop) r) interval)) + (g-step (/ (- (nth 1 stop) g) interval)) + (b-step (/ (- (nth 2 stop) b) interval)) result) (dotimes (_ step-number) (push (list (setq r (+ r r-step)) -- 2.39.5