Hello, I found pretty peculiar fact that your teammates can be so much different from your teammates (not shared armies)... I think it would be good idea to set of team color palettes for each team, so every team member could choose (or be assigned) variant of it's team color. Other idea would be just adding option (switchable in players list) to display only 3 colors: Player (blue), Enemy (red) and Allies (yellow). I think it would add more clarity and cleaner aesthetics as well as avoid confusion... believe or not but I played with few guys that send army on me and didn't know for a while why its units aren't engaging me .
You can do this arbitrarily. In most newer RTS, you can choose any from 256 colors sometimes, and enemies can have very close shades of red even, but obviously it would be an arbitrary choice to choose differing colors from enemies and similar colors to teammates, and besides a server option enforcing similar colors I would hate not to be able to have personal choice of color. Basically, make a lobby option to enforce this, and/or leave it as player's choice to do this, as why wouldn't a player cooperate with this to begin with? Why would they choose light red when the enemy is dark red and the teammate is light blue, why not choose dark blue?
hmmm. maybe that could become the role of the secondary color. the primary color would dictate the team, and the secondary color would tell you which player of that team the unit belongs to.