Not easy, it's not up to date since I added new units.
What I do: create a palette where all the "civ coloured red" becomes green (0,255,0), others are black, so I don't risk to use one of these colour and have my unit32 become civ coloured when they should.
Then I reduce colour from my truecolour image, and use remaining colours to fill the empty (black) slots.
Why didn't Firaxis just use the small icon pcx?