There are no reviewed versions of this page, so it may not have been checked for adherence to standards.

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["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