Voice colors are added in a particular order, but the actual assignment of color to voice number also depends on the order in which the voices are created (or first used). The first voice you use will always be blue, and the second will always be red, but the first voice you use may be Downstem Voice 1 rather than Upstem Voice 1. Then throw into the mix that at any point you can right-click on any note and switch that entire voice from being a Default Stems Up voice to a Default Stems Down voice, which will change the name of the voice, and its behaviour, but not its color.