Content deleted Content added
create mirror of Module:Gridiron color/sandbox |
simplify, make more robust |
||
(3 intermediate revisions by the same user not shown) | |||
Line 22:
local function get_year(colors, year)
year = tonumber(year)
if year and (year > 0) and colors and colors[6] and type(colors[6] == 'table') then
for team, year_colors in pairs(colors[6]) do▼
local end_year = nil
end
if end_year then return colors[6][end_year] end
end
Line 69 ⟶ 67:
end
▲ colors = get_year(color_data[team], year)
if ( colors and type(colors) == 'string' ) then
Line 94 ⟶ 87:
local args = frame.args.team and frame.args or frame:getParent().args
local colors = get_colors((args.team or args[1]), nil, args.year)
return '["' .. args.team .. '"] =
'", '.. colors[3] .. '", '.. colors[4] .. '", '.. colors[5] .. '"
end
|