Project 23: Color Match

Digital Colors can be expressed as an rgb value:

a red component which ranges from 0 to 255.

a green component which ranges from 0 to 255.

a blue component which ranges from 0 to 255.

Here are some examples:

Project 22: Variables 'r', 'g', 'b' have been initialized. 

the values of r, g, and b represent the red, green, and blue components from 0 to 255.

Task: Appropriately initialize the value 'color' that represents the best match for color from the following colors

'black' if all components are less than 50.

'white' if all components are greater than 205.

'grey' if all three components are within 50 of the other two components. 

if none of the three conditions above are met:

'red' if the highest component of the three is r

'green' if the highest component of the three is g

'blue if the highest component of the three is b


i.e. color = 'black'   (how you would initialize a variable with letters)

**If your code works for 5 test cases in a row, you can enter your e-mail address.

Universal Computational Math Methods:

pow(5,2) returns 25.0

abs(-3.0) returns 3

sqrt(49.0) returns 7.0