The other thing to notice about this script is that it assumes certain variables contain the appropriate information. For example, the min variable is assumed to hold a string value of either "red", "green" or "blue". This is why I was lazy and returned those values from the previous function.
The other information assumed to exist by this function is that the three
variables, difRed, difGreen and difBlue, hold the differences between the
two colours in decimal notation, and have negative values where appropriate.