Repair error in hsv->color

This commit is contained in:
Tony Garnock-Jones 2016-09-25 15:05:07 -04:00
parent 39e46c1cfa
commit be7cf7417d
1 changed files with 2 additions and 1 deletions

View File

@ -21,7 +21,8 @@
[(< h* 4) (values 0 x chroma)]
[(< h* 5) (values x 0 chroma)]
[else (values chroma 0 x)]))
(define (scale x) (inexact->exact (truncate (* 255 x))))
(define m (- v chroma))
(define (scale x) (inexact->exact (truncate (* 255 (+ x m)))))
(make-color (scale r) (scale g) (scale b)))
(define (color-by-hash v)