IFSC 3300 HW9 due Oct 26, 2022

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

 

1. Recall , except the 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 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).

Option A: Building on the previous HW's buttons program (or starting a new program if you prefer), 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), create several modifications that use colors based on the 6-digit, hexadecimal-based, RGB method just described.

2. Brown is an interesting color. It is actually dark orange (I used to think brown was dark yellow, but dark yellow is actually a sort of greenish hued 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.

3. 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.