Here is the example, the professor gave us:
; swap-red-blue : image -> image
; Swap the red and blue intensities of c
(check-expect (swap-red-blue (make-color 5 10 15 20))
(make-color 15 10 5 20))
;
(define (swap-red-blue c)
(make-color
(color-blue c)
(color-green c)
(color-red c)
(color-alpha c)))
By copying this model, it is very easy for me to switch the colour or change one colour to another colour. I find that this is more easier to change the image than doing so in Photoshop. Really Cool!
No comments:
Post a Comment