Module:Infobox road/color/CAN

MyWikiBiz, Author Your Legacy — Wednesday December 04, 2024
< Module:Infobox road‎ | color
Revision as of 23:21, 15 July 2021 by Zoran (talk | contribs) (Pywikibot 6.4.0)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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:#fff;"
    end
    local province = args.province
    local type = args.type or ''
    if type == province then
        return "background:#006A4D; color:#fff;"
    end
    return self[type] or "background:#cedff2;"
end

for i,type in pairs({"A", "Autoroute", "ATCH", "Fwy", "Toronto"}) do
    colors[type] = "background:#003F87; color:#fff;"
end

for i,type in pairs({"Hwy", "PR", "PTH", "Route", "Trunk", "Sec", "Secondary", "TCH", "Parkway"}) do
    colors[type] = "background:#006A4D; color:#fff;"
end

for i,type in pairs({"QC OLD"}) do
    colors[type] = "background:#AAA;"
end

p.colors = colors
return p