I imagine something like this: (totalnumber is number of teams + something)
- Code: Select all
pickcolor = function(army, i, totalnumber)
local red = math.sin(math.pi*i/totalnumber) * 127 + 128
local green = math.sin(math.pi*i/totalnumber+2*math.pi/3) * 127 + 128
local blue = math.sin(math.pi*i/totalnumber+4*math.pi/3) * 127 + 128
SetArmyColor(army,red,green,blue)
end
and in the button (here: https://github.com/FAForever/fa/blob/c9 ... on.lua#L82) something like this:
- Code: Select all
local sortedArmyList
local totalnumber = table.getn(ListArmies()) + 2 * NumberOfTeams
for i, army in sortedArmyList do
pickcolor(army, i, totalnumber)
end
(need to check how to get the teamnumber for the players, so the sorting and counting of the teams is a bit sketchy for now)