Module:Infobox road/color/CAN
Documentation for this module may be created at Module:Infobox road/color/CAN/doc
local p = {}
local colors = {}
function colors:color(args)
local headerType = args.headerType
if headerType == "freeway" then
return "background:#003F87; color:white;"
end
local province = args.province
local type = args.type or ''
if type == province then
return "background:#006A4D; color:white;"
end
return self[type] or "background:#cedff2;"
end
for i,type in pairs({"A", "Autoroute", "ATCH", "Fwy"}) do
colors[type] = "background:#003F87; color:white;"
end
for i,type in pairs({"Hwy", "PR", "PTH", "Route", "Trunk", "Sec", "Secondary", "TCH"}) do
colors[type] = "background:#006A4D; color:white;"
end
p.colors = colors
return p