Permit non-integral color gradients
* lisp/color.el (color-gradient): Float the step-number.
This commit is contained in:
parent
61b8f9c490
commit
8d433d9b22
1 changed files with 4 additions and 3 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Reference in a new issue