Module:Sandbox/AB-me/Racing table: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 72:
table.insert(t, '|' .. r[j][i] .. '\n')
else
table.insert(t, '|\n')
local color = { "#ffffbf", nil }
if (color ~= nil) then
table.insert(t, '|style="')
if (color[1] ~= nil) then
table.insert(t,'background-color:' .. color[1])
end
if (color[2] ~= nil) then
table.insert(t,'color:' .. color[2])
end
table.insert(t, '"|')
else
table.insert(t, '|\n')
end
end
end
Line 95 ⟶ 83:
return table.concat(t)
end
 
function p.getColor(pos, inPoints)
if (pos == 1) then return colors["first"]
elseif (pos == 2) then return colors["second"]
elseif (pos == 3) then return colors["third"]
elseif (pos <= inPoints) then return colors["points"]
elseif (pos == nil) then return nil
else return colors["nonPoints"] end
end