Module:Infobox road/color/JEY

MyWikiBiz, Author Your Legacy — Friday December 27, 2024
Jump to navigationJump to search

Documentation for this module may be created at Module:Infobox road/color/JEY/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