Jump to content

Модул:Infobox road/color/GBR

Мавод аз Википедиа — донишномаи озод
Ҳуҷҷатгузорӣ
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