Team colors changed mid game

I was playing a 2v2 AI game. Team Mongols vs team Chinese. There were four colors, Blue (me), Red (ally), Yellow (enemy), Green (enemy). Sometime after I defeated Yellow, not sure when, Red switched to yellow and Green switched to red. It was extremely confusing.