
Suzanne O. answered 01/14/20
International Experience and Multiple State Certifications
Hi Chris. An interesting question:
Suppose you were told that the colors that will work best for your web app are (r, g, b) where
r mod 16 = 0 and g mod 16 = 0 and b mod 16 = 0. Give three distinct examples of such
colors. For each example, specify its red, green, and blue components both in decimal and in
hexadecimal. Justify each of your examples with (clear, correct, complete) calculations and/or
references to definitions, and connecting these calculations and/or definitions with the desired
properties.
It looks like you are being quizzed on programming math (r mod 16 = 0), color systems (rgb), programming number systems (decimal & hexadecimal) and maybe a bit of css.
Let's go step by step:
r mod 16 = 0 means r modulus 16 equals 0 or the remainder of r when divided by 16 equals 0
Easy. That makes it any number that when divided by 16 the remainder is 0: 0, 16, 32, 48, 64...
rgb is the red-green-blue color system for screen output. Each color value (r, g, b) is a number from 0 to 255 (256 possible numbers) and the color on the screen is the result of the three combined. So for example:
- r=0 g=0 b=0 is black
- r=255 g=255 b=255 is white
- r=255 g=0 b=0 is red
- r=0 g=255 b=0 is green
- r=0 g=0 b=255 is blue
- r=255 g=0 b=160 is a great hot pink
decimal vs hexadecimal: base10 and base16 number systems. The first 10 digits are the same in both systems, but for hexadecimal there are 6 more digits that are represented by a b c d e f:
- decimal: 0 1 2 3 4 5 6 7 8 9
- hexadecimal: 0 1 2 3 4 5 6 7 8 9 A B C D E F
That would make 16 in decimal look like 10 in hexadecimal and 160 in decimal looks like A0 in hexadecimal.
Lastly, if you are programming in an html environment, you can change the default attributes by using a combination of html, javascript and css. For example:
The default text color is black in the H1 tag. To change the color, you use the style attribute (javascript) with css information. So the commands inside the tag brackets would look like H1 style="color:rgb(16, 64, 160);" and the headline 1 color is a blue. And it is javascript, not the html style tag because of the assignment statement used.
So far so good?
So from my understanding of the question, you need to:
- pick 3 colors for you web app
- use only rgb values that can be divided by 16 and leave 0 as a remainder. You can use rgb (16, 64, 160) for a medium blue, or any combination of multiples of 16 that are less than 255.
- convert the rgb decimal values to hexadecimal. The rgb(16, 64, 160) would become #1040A0
- show your work
And if you have a web app that you are coding right now, apply the color values where you plan on using them (background, headlines, body text...).