1) If the number is odd, add 1 to it.
2) Divide by 6.
3) The remainder will be either 0, 2 or 4.
If 0, the color is black or brown.
If 2, the color is red or orange.
If 4, the color is blue or yellow.
I prefer 4.
If single phase, divide by 4.
0 is black.
2 is red.
~Peter