Module:Infobox road/color/GBR

MyWikiBiz, Author Your Legacy — Thursday December 05, 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/GBR/doc

local p = {}

local colors = {}
function colors:color(args)
    local type = args.type
    local subtype = args.subtype
    subtype = subtype and string.lower(subtype) or ''
    local colorFunc = self[type]
    return colorFunc and colorFunc(subtype) or "background:#fff; border:1px solid #000;"
end

local function motorway()
    return "background:#0079C1; color:#fff;"
end
colors["M"] = motorway
colors["MNamed"] = motorway
colors["AM"] = motorway
colors["Motorway"] = motorway

local function ARoad(subtype)
    return (subtype == "minor") and "background:#fff; border:1px solid #000;" or "background:#00703C; color:#FFD200;"
end
colors["A"] = ARoad
colors["A road"] = ARoad

p.colors = colors
return p