IFSC 3300 HW9 due W Oct. 23, 2024

Directions: Email your results to IFSC3300hw@gmail.com.

 

1. Recall , which is like a button in a previous HW except the background color is different this time and, more importantly, the way the color is specified is different: instead of having background-color:green it has background-color:#FC9630 (check the source code for this page for more details on the button). This uses the RGB (red-green-blue) color specification method. The six hexadecimal digits FC9630 indicate FC for the amount of red, 96 for the amount of green, and 30 for the amount of blue; FC is a lot of red, almost FF which is the maximum 2-digit hexadecimal (specifically, FC=FF-3, or in base 10, 252=255-3). Red and green, if they were in approximately equal amounts, would give yellow. However in this case there is less green (96 out of the maximum possible FF in hexadecimal, which is the same as 150 out of 255 in decimal numbers), which moves the color to between yellow and red, or orange. The amount of blue mixed in, 30 out of FF (hex) = 48 out of 255 (decimal), is so small that it doesn't affect the orange that much. It makes the orange color a little lighter since all colors together combine to make white, so now we have orange with a little white (48 units of blue, combining with 48 units of the 252 units of red, and 48 of the 150 units of green to make a bit of white) mixed in with the orange. 48 out of a possible 255 isn't that much, and if it wasn't mixed in with the orange, 48 alone of the three colors, mixed together, would be a dark gray (that is, between white and black but closer to black, where a pure black is color 000000 and a maximally bright white is FFFFFF).

Explain why the above button is bright orange.

2. Pick Option A or Option B.

Option A: Building on the previous HW's buttons program (at this point, avoid starting a new buttons program), create several buttons that demonstrate colors using the 6-digit, hexadecimal-based, RGB method just described.

Option B: Building on the previous HW's game (or starting a new one if you prefer is still fine), create several modifications that use colors based on the 6-digit, hexadecimal-based, RGB method just described.

3. Brown is an interesting color. It is actually dark orange. (I used to think brown was dark yellow, but dark yellow is actually a greenish brown.) Make an orange button. Then change it to be brown. Avoid mixing the button into the middle of your answer to the previous question which would make it harder for the grader to notice it, resulting in possible loss of credit.

4. Demonstrate a bunch of events. Use buttons or a game, or any other way (most of the events work just as well with other HTML elements like <p>, <span>, <h1>...<h6>, etc. as they do with buttons). Explain what you did.