-
-
Save a-sk/5697219 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (h->rgb h) | |
(define hi (round (/ h 60))) | |
(define vmin 0) | |
(define a ( round (* 100 (/ (modulo h 60) 60)))) | |
(define vinc a) | |
(define vdec (- 100 a)) | |
(print hi) | |
(cond | |
((= hi 0) (list (round (* 2.55 100 )) (round (* 2.55 vinc )) (round (* 2.55 vmin )))) | |
((= hi 1) (list (round (* 2.55 vdec )) (round (* 2.55 100 )) (round (* 2.55 vmin )))) | |
((= hi 2) (list (round (* 2.55 vmin )) (round (* 2.55 100 )) (round (* 2.55 vinc )))) | |
((= hi 3) (list (round (* 2.55 vmin )) (round (* 2.55 vdec )) (round (* 2.55 100 )))) | |
((= hi 4) (list (round (* 2.55 vinc )) (round (* 2.55 vmin )) (round (* 2.55 100 )))) | |
((= hi 5) (list (round (* 2.55 100 )) (round (* 2.55 vmin )) (round (* 2.55 vdec )))) | |
) | |
) | |
(define (getColor i) | |
(h->rgb (round (/ (+ (* i (/ 360 Step)) (* (+ i 1) (/ 360 Step)) ) 2))) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment