CSC104H1 Lecture Notes - Lecture 6: Data Type

25 views1 pages
26 Sep 2016
School
Course

Document Summary

; the function make-color" takes three numbers in (range 0 256 1)" for red, green, and blue. ; intensities (and optionally a fourth number for the opacity), and produces a color value. ; that can be used with the geometric shape functions. ; when not specifying the opacity, it"s used as a ternary function (and the opacity is then. ; automatically set to 255, which means fully opaque). ; make-color : number number number color (require picturing-programs) ; a pastel green circle: (check-expect (circle 50 solid (make-color 150 255 150)) ; a very green circle: (check-expect (circle 50 solid (make-color 0 255 0)) ; a yellow circle: (check-expect (circle 50 solid (make-color 255 255 0)) ; a randomly coloured circle: (circle 50 solid (make-color (random 256) (random 256) (random 256)))

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents