I believe it can be done...
and it would take only XML editing...
you would have to edit these there files...
CIV4PlayerColorInfos.xml
CIV4ColorVals.xml
CIV4CivilizationInfos.xml
where:
CIV4PlayerColorInfos.xml
defines the color setup:
<PlayerColorInfo>
<Type>PLAYERCOLOR_BLUE</Type>
<ColorTypePrimary>COLOR_PLAYER_BLUE</ColorTypePrimary>
<ColorTypeSecondary>COLOR_PLAYER_WHITE</ColorTypeSecondary>
<TextColorType>COLOR_PLAYER_BLUE_TEXT</TextColorType>
</PlayerColorInfo>
where
<ColorTypePrimary> is the border color
and
CIV4ColorVals.xml
defines the color "pigments" :
<ColorVal>
<Type>COLOR_PLAYER_BLUE</Type>
<fRed>0.21</fRed>
<fGreen>0.40</fGreen>
<fBlue>1.00</fBlue>
<fAlpha>1.00</fAlpha>
</ColorVal>
(as you can see each tag sets the pigment a certain way)
and
CIV4CivilizationInfos.xml
defines what civilization gets what color scheme:
using the above example of
<Type>PLAYERCOLOR_BLUE</Type> :
<CivilizationInfo>
<Type>CIVILIZATION_AMERICA</Type>
<Description>TXT_KEY_CIV_AMERICA_DESC</Description>
<ShortDescription>TXT_KEY_CIV_AMERICA_SHORT_DESC</ShortDescription>
<Adjective>TXT_KEY_CIV_AMERICA_ADJECTIVE</Adjective>
<Civilopedia>TXT_KEY_CIV_AMERICA_PEDIA</Civilopedia>
<DefaultPlayerColor>PLAYERCOLOR_BLUE</DefaultPlayerColor>
=================
Most Civs (not counting modded/unique civs, i.e. vanilla civs) have their own scheme that is unique....
the problem is when you use two leaders from the same civ (then one gets the default color and I guess the game assigns the other another color)
also if the colors are close in pigment it is hard to differentiate between borders (I am having that problem with 2 of my unique civs)
so the trick is to come up with 18 total distinct colors that you can tell the difference between....
the only problem is achieve that .....
there are probably other ways to change this but Im not a great modder... I only(well mainly) mess around with XML
I dont have any coding skill in Python or SDK to tell you if scripts can be made to achieve your goal (sorry

)
however those xml files you can define... unique colors... hopefully enough to tell your 18 civs apart...
(there is a long way to make unique colors for EACH leader... but that would take alot of cut and pasting.... and also I doubt you could come up with that many colors that are distinct or dont blend

)
anyway... your idea about 18 diff. colors has peaked my interest and maybe I can fix that 2 civ "similar/blending" in my current play testing....
I not sure this info helps alot... but I hope it helps a little
good luck
