In Lesson 8.14a we added three new parameters to the drawFish function--red, green, and blue--to allow us to specify hexadecimal color values for the fish color. In this lesson we will use a slightly different approach to specify the fish color, using regular numeric values from 0 to 255 for the red, green, and blue values (with 255 representing maximum color). We will use this feature later (especially in Lesson 9.8) to draw fish with random colors. To start, load your saved file from Lesson 8.14a. (Click on the "File" button" at the top left of the RoboBlockly window.)
|
Grid Size: S M L | Simple View: | MinView: |
|
Coord: x-axis y-axis | Grid Lines: x-axis y-axis | |||
Grid: | 12x12 inches | 24x24 inches | 36x36 inches | |
72x72 inches | 96x96 inches | 192x192 inches | ||
1x1 inches | 2x2 inches | Fraction: | ||
xy-Range: | ||||
|
||||
|
||||
Quad: | 1 Quadrant | 4 Quadrants | 1&4 Quadrants | |
Units: | US Customary | Metric | Ruler: |
Labels: |
|
|
|
Font
px
|
|
Tics Lines: |
|
Width
px
|
Hash Lines: |
|
Width
px
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
|
Using your code from Lesson 8.14a, modify the "fillColor" code block in the drawFish function so that it uses the "color with" code stub instead of the "hex color with" code stub. Keep the parameters (red, green, blue) as they are. Then change the drawFish function calls in your program so that the parameters used are numbers instead of text, with values between 0 and 255. (Remember that the number stub is found in the Math tab menu.) See the hint if you get stuck, and don't forget to save your work to the cloud in an xml file named "YourName_Lesson8.14b"! |
|
|
|||||||||||
|
|||||||||||