This section of code is not going to be implemented as a function because it has to create three variables, Rsteps, Gsteps and Bsteps, and functions can only return one value at a time.

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.

Close Window