This is a problem specific to 1.13.x.
On the left side purple village, on the right blue:
For comparision a screnshoot from 1.12.6:
Not really fixable. We tweaked the ToD colors in 1.13, so it's probably a side effect of that.
Well, you could make the flags ignore the ToD colours, I guess; but to me the left one is still recognizably purple.
Flags should match the rings and livery. So, yes, ignore time-of-day for them.
I can not see any difference in the purple and blue on the top image; the error is obvious in the captured village in the middle image, and the bottom image shows it was not an issue in 1.12.
Any fix probably wants to go into 1.14 branch as well as master.
I also can see a difference between purple and blue fairly easily... though for those who may be colour-blind or at least borderline, I can see this being an issue. Exempting any environmental adjustment to flag colours sounds like a good idea.
Workaround: sides that have similar colors should use different flag shapes ({FLAG_VARIANT}).
Also, created #4344, which would be another workaround if implemented.
That workaround is only valid for campaigns, since in MP the designer has no control over which side is which colour.
In MP one could just give each side a different flag variant... "7 flag variants should be enough for anybody" :)