Module:TierColour/data

< Module:TierColour
Revision as of 20:26, February 15, 2024 by Toomai (talk | contribs)

Documentation for this module may be created at Module:TierColour/data/doc

local RED = {255,0,0}
local ORG = {255,127,0}
local YLW = {255,255,0}
local CHR = {127,255,0}
local GRN = {0,255,0}
local AQU = {0,255,127}
local CYN = {0,255,255}
local AZR = {0,127,255}
local BLU = {0,0,255}
local VIO = {127,0,255}
local MGN = {255,0,255}
local PRP = {127,0,127}

function col_avg(...)
	newCol = {0,0,0}
	for i,v in ipairs(arg) do
		newCol[1] = newCol[1] + v[1]
		newCol[2] = newCol[2] + v[2]
		newCol[3] = newCol[3] + v[3]
	end
	newCol[1] = newCol[1] / arg["n"]
	newCol[2] = newCol[2] / arg["n"]
	newCol[3] = newCol[3] / arg["n"]
	return newCol
end

local tierColourList = {
	[ 4] = {RED, YLW, GRN, BLU},
	[ 5] = {RED, ORG, YLW, GRN, BLU},
	[ 6] = {RED, ORG, YLW, GRN, BLU, MGN},
	[ 7] = {RED, ORG, YLW, GRN, CYN, BLU, MGN},
	[ 8] = {RED, ORG, YLW, GRN, CYN, BLU, MGN, PRP},
	[ 9] = {RED, ORG, YLW, CHR, GRN, CYN, BLU, MGN, PRP},
	[10] = {RED, ORG, YLW, CHR, GRN, CYN, AZR, BLU, MGN, PRP},
	[11] = {RED, ORG, col_avg(ORG,YLW), YLW, CHR, GRN, CYN, AZR, BLU, MGN, PRP},
	[12] = {RED, ORG, col_avg(ORG,YLW), YLW, CHR, GRN, AQU, CYN, AZR, BLU, MGN, PRP},
	[13] = {RED, ORG, col_avg(ORG,YLW), YLW, CHR, GRN, AQU, CYN, AZR, BLU, VIO, MGN, PRP},
	[14] = {RED, ORG, col_avg(ORG,YLW), YLW, CHR, GRN, AQU, CYN, AZR, BLU, VIO, MGN, col_avg(MGN,PRP), PRP},
	[15] = {RED, ORG, col_avg(ORG,YLW), YLW, CHR, GRN, AQU,
			CYN, AZR, col_avg(AZR,BLU), BLU, VIO, MGN, col_avg(MGN,PRP), PRP},
	[16] = {RED, col_avg(RED,ORG), ORG, col_avg(ORG,YLW), YLW, CHR, GRN, AQU,
			CYN, AZR, col_avg(AZR,BLU), BLU, VIO, MGN, col_avg(MGN,PRP), PRP},
	[17] = {RED, col_avg(RED,ORG), ORG, col_avg(ORG,YLW), YLW, CHR, GRN, AQU,
			CYN, col_avg(CYN,AZR), AZR, col_avg(AZR,BLU), BLU, VIO, MGN, col_avg(MGN,PRP), PRP},
	[18] = {RED, col_avg(RED,ORG), ORG, col_avg(ORG,YLW), YLW, CHR, GRN, AQU,
			CYN, col_avg(CYN,AZR), AZR, col_avg(AZR,BLU), BLU, VIO, col_avg(VIO,MGN), MGN, col_avg(MGN,PRP), PRP},
	[19] = {RED, col_avg(RED,ORG), ORG, col_avg(ORG,YLW), YLW, CHR, col_avg(CHR,GRN), GRN, AQU,
			CYN, col_avg(CYN,AZR), AZR, col_avg(AZR,BLU), BLU, VIO, col_avg(VIO,MGN), MGN, col_avg(MGN,PRP), PRP},
	[20] = {RED, col_avg(RED,ORG), ORG, col_avg(ORG,YLW), YLW, CHR, col_avg(CHR,GRN), GRN, AQU, col_avg(AQU,CYN),
			CYN, col_avg(CYN,AZR), AZR, col_avg(AZR,BLU), BLU, VIO, col_avg(VIO,MGN), MGN, col_avg(MGN,PRP), PRP},
}

return tierColourList