"मोड्युल:Infobox road/color" का संशोधनहरू बिचको अन्तर
स्वरूप
Content deleted Content added
सा en:Module:Infobox_road/color बाट ३६ संशोधन(हरू): Improting Module |
कुनै सम्पादन सारांश छैन |
||
पङ्क्ति ३८: | पङ्क्ति ३८: | ||
local color = self[name] |
local color = self[name] |
||
if color then return color end |
if color then return color end |
||
if name == 'CAN' then |
|||
local module = require(string.format("Module:Infobox road/color/%s", name)) |
|||
local module = require(string.format("Module:Infobox road/color/%s", name)) |
|||
return module.colors |
|||
return module.colors |
|||
else |
|||
error("Country not included", 0) |
|||
end |
|||
end |
end |
||
do -- Single-color countries |
do -- Single-color countries |
||
colors. |
colors.ARG = Country:new{default = "background:#006A4D; color:#fff;"} |
||
colors. |
colors.BEL = Country:new{default = "background:#005b8c; color:#fff;"} |
||
colors. |
colors.BGD = Country:new{default = "background:#2C6700; color:#fff;"} |
||
colors. |
colors.BOL = Country:new{default = "background:#006A4D; color:#fff;"} |
||
colors.CHL = Country:new{default = "background:#006A4D; color:#fff;"} |
|||
colors.CHN = Country:new{default = "background:#006A4D; color:#fff;"} |
|||
colors.CRI = Country:new{default = "background:#006A4D; color:#fff;"} |
|||
colors.ECU = Country:new{default = "background:#006A4D; color:#fff;"} |
|||
colors.EST = Country:new{default = "background:#0079C1; color:#fff;"} |
|||
colors.EUR = Country:new{default = "background:#08842C; color:#fff;"} |
colors.EUR = Country:new{default = "background:#08842C; color:#fff;"} |
||
colors. |
colors.IND = Country:new{default = "background:#128807; color:#fff;"} |
||
colors.JOR = Country:new{default = "background:#0079C1; color:#fff;"} |
|||
colors.HKG = Country:new{default = "background:#006A4D; color:#fff;"} |
colors.HKG = Country:new{default = "background:#006A4D; color:#fff;"} |
||
colors.ISL = Country:new{default = "background:#FFD200; border: |
colors.ISL = Country:new{default = "background:#FFD200; border:2px solid #000;"} |
||
colors.MEX = Country:new{default = "background:#006A4D; color:#fff;"} |
|||
colors.NZL = Country:new{default = "background:#006A4D; color:#fff;"} |
colors.NZL = Country:new{default = "background:#006A4D; color:#fff;"} |
||
colors. |
colors.SWE = Country:new{default = "background:#003F87; color:#fff;"} |
||
colors.URY = Country:new{default = "background:#006A4D; color: |
colors.URY = Country:new{default = "background:#006A4D; color:#fff;"} |
||
colors.VNM = Country:new{default = "background:#003399; color: |
colors.VNM = Country:new{default = "background:#003399; color:#fff;"} |
||
end -- Single-color countries |
end -- Single-color countries |
||
पङ्क्ति ६३: | पङ्क्ति ७४: | ||
colors.ALB = ALB |
colors.ALB = ALB |
||
end -- Albania |
end -- Albania |
||
do -- UAE |
|||
local ARE = Country:new{default = "background:#008033; color:#fff;"} |
|||
ARE:addTypesAsColor({"E"}, "background:#0044aa; color:#fff;") |
|||
colors.ARE = ARE |
|||
end -- UAE |
|||
do -- Asian Highway Network |
|||
local ASIA = Country:new{default = "background:#fff; border:2px solid #000;"} |
|||
ASIA:addTypesAsColor({"AH"}, "background:#1e2c76; color:#fff;") |
|||
colors.ASIA = ASIA |
|||
end -- Asian Highway Network |
|||
do -- Australia |
do -- Australia |
||
local AUS = Country:new{default = "background:#3A7119; color:#FFE133;"} |
local AUS = Country:new{default = "background:#3A7119; color:#FFE133;"} |
||
पङ्क्ति ७३: | पङ्क्ति ९४: | ||
end -- Australia |
end -- Australia |
||
do -- Austria |
do -- Austria |
||
local AUT = Country:new{default = "background:#fff; border: |
local AUT = Country:new{default = "background:#fff; border:2px solid #000;"} |
||
AUT:addTypesAsColor({"A", "S", "B"}, "background:#276FB7; color:#fff;") |
AUT:addTypesAsColor({"A", "S", "B"}, "background:#276FB7; color:#fff;") |
||
colors.AUT = AUT |
colors.AUT = AUT |
||
end -- Austria |
end -- Austria |
||
do -- Bosnia and Herzegovina |
|||
local BIH = Country:new{default = "background:#0B8F4B; color:#fff;"} |
|||
BIH:addTypesAsColor({"M", "B"}, "background:#0066CC; color:#fff;") |
|||
BIH:addTypesAsColor({"R"}, "background:#FFCC33; border:2px solid #000;") |
|||
colors.BIH = BIH |
|||
end -- Bulgaria |
|||
do -- Bulgaria |
do -- Bulgaria |
||
local BGR = Country:new{default = "background:#003F87; color: |
local BGR = Country:new{default = "background:#003F87; color:#fff;"} |
||
BGR:addTypesAsColor({"A"}, "background:#006A4D; color: |
BGR:addTypesAsColor({"A"}, "background:#006A4D; color:#fff;") |
||
colors.BGR = BGR |
colors.BGR = BGR |
||
end -- Bulgaria |
end -- Bulgaria |
||
पङ्क्ति ८६: | पङ्क्ति ११३: | ||
HRV:addTypesAsColor({"E", "A"}, "background:#08842C; color:#fff;") |
HRV:addTypesAsColor({"E", "A"}, "background:#08842C; color:#fff;") |
||
HRV:addTypesAsColor({"D"}, "background:#0066CC; color:#fff;") |
HRV:addTypesAsColor({"D"}, "background:#0066CC; color:#fff;") |
||
HRV:addTypesAsColor({"Z"}, "background:#FFCC33 |
HRV:addTypesAsColor({"Z"}, "background:#FFCC33;") |
||
colors.HRV = HRV |
colors.HRV = HRV |
||
end -- Croatia |
end -- Croatia |
||
पङ्क्ति ९५: | पङ्क्ति १२२: | ||
end -- Cyprus |
end -- Cyprus |
||
do -- Czech Republic |
do -- Czech Republic |
||
local CZE = Country:new{default = "background:#003F87; color: |
local CZE = Country:new{default = "background:#003F87; color:#fff;"} |
||
CZE:addTypesAsColor({"D", "R"}, "background:#006A4D; color: |
CZE:addTypesAsColor({"D", "R"}, "background:#006A4D; color:#fff;") |
||
colors.CZE = CZE |
colors.CZE = CZE |
||
end -- Czech Republic |
end -- Czech Republic |
||
पङ्क्ति १०२: | पङ्क्ति १२९: | ||
local DNK = Country:new{default = "background:#039; color:#fff;"} |
local DNK = Country:new{default = "background:#039; color:#fff;"} |
||
DNK:addTypesAsColor({"E", "M"}, "background:#006A4D; color:#fff;") |
DNK:addTypesAsColor({"E", "M"}, "background:#006A4D; color:#fff;") |
||
DNK:addTypesAsColor({"S"}, "background:#fff; border: |
DNK:addTypesAsColor({"S"}, "background:#fff; border:2px solid #af1e2d; color:#af1e2d;") |
||
colors.DNK = DNK |
colors.DNK = DNK |
||
end -- Denmark |
end -- Denmark |
||
do -- Finland |
|||
local FIN = Country:new{default = "background:#005eb8; color:#fff;"} |
|||
FIN:addTypesAsColor({"E"}, "background:#009775; color:#fff;") |
|||
colors.FIN = FIN |
|||
end -- Finland |
|||
do -- France |
do -- France |
||
local FRA = Country:new{default = "background:#fff; border: |
local FRA = Country:new{default = "background:#fff; border:2px solid #000;"} |
||
FRA:addTypesAsColor({"A"}, "background:#0079C1; color:#fff;") |
FRA:addTypesAsColor({"A"}, "background:#0079C1; color:#fff;") |
||
FRA:addTypesAsColor({"N"}, "background:#006A4D; color:#fff;") |
FRA:addTypesAsColor({"N"}, "background:#006A4D; color:#fff;") |
||
FRA:addTypesAsColor({"E"}, "background:#28961e; color:#fff;") |
|||
colors.FRA = FRA |
colors.FRA = FRA |
||
colors.MTQ = FRA |
colors.MTQ = FRA |
||
colors.DZA = FRA |
|||
end -- France |
end -- France |
||
do -- Georgia |
do -- Georgia |
||
पङ्क्ति ११९: | पङ्क्ति १५३: | ||
do -- Germany |
do -- Germany |
||
local DEU = Country:new{default = "background:#cedff2;"} |
local DEU = Country:new{default = "background:#cedff2;"} |
||
DEU:addTypesAsColor({"A", "Autobahn"}, "background:# |
DEU:addTypesAsColor({"A", "Autobahn"}, "background:#003ABD; color:#fff;") |
||
DEU:addTypesAsColor({"B", "Bundesstraße", "Bundesstrasse"}, "background:#FC3; |
DEU:addTypesAsColor({"B", "Bundesstraße", "Bundesstrasse"}, "background:#FC3;") |
||
DEU:addTypesAsColor({"E"}, "background:#08842C; color:#fff;") |
DEU:addTypesAsColor({"E"}, "background:#08842C; color:#fff;") |
||
DEU:addTypesAsColor({"Scenic"}, "background:#633A34; color:#fff;") |
|||
colors.DEU = DEU |
colors.DEU = DEU |
||
end -- Germany |
end -- Germany |
||
do -- Ghana |
do -- Ghana |
||
local GHA = Country:new{default = "background:#006A4D; color:# |
local GHA = Country:new{default = "background:#006A4D; color:#fff;"} |
||
GHA:addTypesAsColor({"N"}, "background:#0079C1; color:# |
GHA:addTypesAsColor({"N"}, "background:#0079C1; color:#fff;") |
||
colors.GHA = GHA |
colors.GHA = GHA |
||
end -- Ghana |
end -- Ghana |
||
do -- Greece |
do -- Greece |
||
local GRC = Country:new{default = "background:#0079C1; color:# |
local GRC = Country:new{default = "background:#0079C1; color:#fff;"} |
||
GRC:addTypesAsColor({"A"}, "background:#006A4D; color:# |
GRC:addTypesAsColor({"A"}, "background:#006A4D; color:#fff;") |
||
colors.GRC = GRC |
colors.GRC = GRC |
||
end -- Greece |
end -- Greece |
||
पङ्क्ति १४१: | पङ्क्ति १७६: | ||
do -- Iran |
do -- Iran |
||
local IRN = Country:new{default = "background:#cedff2;"} |
local IRN = Country:new{default = "background:#cedff2;"} |
||
IRN:addTypesAsColor({"freeway"}, "background:# |
IRN:addTypesAsColor({"freeway"}, "background:#0079C1; color:#fff;") |
||
IRN:addTypesAsColor({"expressway"}, "background:# |
IRN:addTypesAsColor({"expressway", "road"}, "background:#00703C; color:#fff;") |
||
IRN:addTypesAsColor({" |
IRN:addTypesAsColor({"boulevard", "street"}, "background:#fff; color:#000;") |
||
IRN:addTypesAsColor({"boulevard"}, "background:#fff; color:#000;") |
|||
IRN:addTypesAsColor({"street"}, "background:#fff; color:#000;") |
|||
colors.IRN = IRN |
colors.IRN = IRN |
||
end -- Iran |
end -- Iran |
||
पङ्क्ति १५२: | पङ्क्ति १८५: | ||
IRL:addTypesAsColor({"M"}, "background:#0079C1; color:#fff;") |
IRL:addTypesAsColor({"M"}, "background:#0079C1; color:#fff;") |
||
IRL:addTypesAsColor({"N"}, "background:#00703C; color:#FFD200;") |
IRL:addTypesAsColor({"N"}, "background:#00703C; color:#FFD200;") |
||
IRL:addTypesAsColor({"R"}, "background:#fff; border: |
IRL:addTypesAsColor({"R"}, "background:#fff; border:2px solid #000;") |
||
colors.IRL = IRL |
colors.IRL = IRL |
||
end -- Republic of Ireland |
end -- Republic of Ireland |
||
do -- Isle of Man |
|||
local IMN = Country:new{default = "background:#fff; border:2px solid #000;"} |
|||
IMN:addTypesAsColor({"A", "Primary"}, "background:#00703C; color:#FFD200;") |
|||
colors.IMN = IMN |
|||
end -- Isle of Man |
|||
do -- Israel |
|||
local ISR = Country:new{default = "background:#007E00; color:#fff;"} |
|||
ISR:addTypesAsColor({"Fwy", "Freeway", "Dual"}, "background:#0000FE; color:#fff;") |
|||
colors.ISR = ISR |
|||
end -- Israel |
|||
do -- Italy |
do -- Italy |
||
local ITA = Country:new{default = "background:#cedff2;"} |
local ITA = Country:new{default = "background:#cedff2;"} |
||
ITA:addTypesAsColor({"A"}, "background:#08842C; color:#fff;") |
ITA:addTypesAsColor({"A"}, "background:#08842C; color:#fff;") |
||
ITA:addTypesAsColor({"RA"}, "background:#08842C; color:#fff;") |
|||
ITA:addTypesAsColor({"SS"}, "background:#003F87; color:#fff;") |
ITA:addTypesAsColor({"SS"}, "background:#003F87; color:#fff;") |
||
ITA:addTypesAsColor({"E"}, "background:#08842C; color:#fff;") |
ITA:addTypesAsColor({"E"}, "background:#08842C; color:#fff;") |
||
colors.ITA = ITA |
colors.ITA = ITA |
||
end -- Italy |
end -- Italy |
||
do -- Jamaica |
|||
local JAM = Country:new{default = "background:#00703C; color:#fff;"} |
|||
JAM:addTypesAsColor({"T"}, "background:#0079C1; color:#fff;") |
|||
colors.JAM = JAM |
|||
end -- Jamaica |
|||
do -- Kosovo |
|||
local KOS = Country:new{default = "background:#0066cc; color:#fff;"} |
local KOS = Country:new{default = "background:#0066cc; color:#fff;"} |
||
KOS:addTypesAsColor({"R"}, "background:#009933; color:#fff;") |
KOS:addTypesAsColor({"R"}, "background:#009933; color:#fff;") |
||
KOS:addTypesAsColor({"E"}, "background:#08842C; color:#fff;") |
KOS:addTypesAsColor({"E"}, "background:#08842C; color:#fff;") |
||
colors.KOS = KOS |
colors.KOS = KOS |
||
end -- |
end -- Kosovo |
||
do -- Nepal |
|||
local NPL = Country:new{default = "background:#fff; border:2px solid #000;"} |
|||
-- NPL:addTypesAsColor({"M", "Motorway", "AM", "MNamed"}, "background:#0079C1; color:#fff;") |
|||
NPL:addTypesAsColor({"H"}, "background:#00703C; color:#fff;") |
|||
colors.NPL = NPL |
|||
end -- Nepal |
|||
do -- Netherlands |
do -- Netherlands |
||
local NLD = Country:new{default = "background:#0079C1; color:#fff;"} |
local NLD = Country:new{default = "background:#0079C1; color:#fff;"} |
||
पङ्क्ति १७३: | पङ्क्ति २२८: | ||
colors.NLD = NLD |
colors.NLD = NLD |
||
end -- Netherlands |
end -- Netherlands |
||
do -- Norway |
|||
local NOR = Country:new{default = "background:#F2A900;"} |
|||
NOR:addTypesAsColor({"E"}, "background:#00965E; color:#fff;") |
|||
colors.NOR = NOR |
|||
end -- Norway |
|||
do -- Northern Ireland |
|||
local NIR = Country:new{default = "background:#fff; border:2px solid #000;"} |
|||
NIR:addTypesAsColor({"M", "Motorway", "AM", "MNamed"}, "background:#0079C1; color:#fff;") |
|||
NIR:addTypesAsColor({"A", "Primary"}, "background:#00703C; color:#FFD200;") |
|||
colors.NIR = NIR |
|||
end -- Northern Ireland |
|||
do -- Malaysia |
do -- Malaysia |
||
local MYS = Country:new{default = "background:#0079C1; color:#fff;"} |
local MYS = Country:new{default = "background:#0079C1; color:#fff;"} |
||
पङ्क्ति १७८: | पङ्क्ति २४४: | ||
colors.MYS = MYS |
colors.MYS = MYS |
||
end -- Malaysia |
end -- Malaysia |
||
do -- Morocco |
|||
do -- Pakistan |
|||
local |
local MAR = Country:new{default = "background:#fff; border:2px solid #000;"} |
||
MAR:addTypesAsColor({"A"}, "background:#0079C1; color:#fff;") |
|||
MAR:addTypesAsColor({"Motorway"}, "background:#0079C1; color:#fff;") |
|||
colors.MAR = MAR |
|||
end -- Morocco |
|||
do -- Pakistan |
|||
local PAK = Country:new{default = "background:#0066cc; color:#fff;"} |
|||
PAK:addTypesAsColor({"M"}, "background:#22B14C; color:#fff;") |
|||
PAK:addTypesAsColor({"E"}, "background:#F5C31D; color:#000;") |
|||
colors.PAK = PAK |
colors.PAK = PAK |
||
end -- Pakistan |
end -- Pakistan |
||
do -- Philippines |
|||
local PHL = Country:new{default = "background:#093; color:#fff;"} |
|||
PHL:addTypesAsColor({"AH", "Asian Highway"}, "background:#1e2c76; color:#fff;") |
|||
colors.PHL = PHL |
|||
end -- Philippines |
|||
do -- Poland |
do -- Poland |
||
local POL = Country:new{default = "background:#006A4D; color:#fff;"} |
local POL = Country:new{default = "background:#006A4D; color:#fff;"} |
||
POL:addTypesAsColor({"A", "S"}, "background:#0079C1; color:#fff;") |
POL:addTypesAsColor({"A", "S"}, "background:#0079C1; color:#fff;") |
||
colors.POL = POL |
colors.POL = POL |
||
end --Poland |
end --Poland |
||
do -- Russia |
|||
local RUS = Country:new{default = "background:#0d69e1; color:#fff;"} |
|||
RUS:addTypesAsColor({"E"}, "background:#00a500; color:#fff;") |
|||
RUS:addTypesAsColor({"AH"}, "background:#00004e; color:#fff;") |
|||
colors.RUS = RUS |
|||
end --Russia |
|||
do -- Slovakia |
do -- Slovakia |
||
local SVK = Country:new{default = "background:#0079C1; color:#fff;"} |
local SVK = Country:new{default = "background:#0079C1; color:#fff;"} |
||
पङ्क्ति १९४: | पङ्क्ति २७८: | ||
end -- Slovakia |
end -- Slovakia |
||
do -- South Africa |
do -- South Africa |
||
local ZAF = Country:new{default = "background:#006A4D; color:# |
local ZAF = Country:new{default = "background:#006A4D; color:#fff;"} |
||
ZAF:addTypesAsColor({"M", "N"}, "background:#0079C1; color:# |
ZAF:addTypesAsColor({"M", "N"}, "background:#0079C1; color:#fff;") |
||
colors.ZAF = ZAF |
colors.ZAF = ZAF |
||
end -- South Africa |
end -- South Africa |
||
do -- Spain |
do -- Spain |
||
local ESP = Country:new{default = "background:#E8E8E8;"} |
local ESP = Country:new{default = "background:#E8E8E8;"} |
||
ESP:addTypesAsColor({" |
ESP:addTypesAsColor({"E"}, "background:#13926C; color:#fff;") |
||
ESP:addTypesAsColor({" |
ESP:addTypesAsColor({"A", "AP", "R", "Autovia", "Autovía", "Autopista", "autovia", "autovía", "autopista"}, "background:#19408B; color:#fff;") |
||
ESP:addTypesAsColor({"N", "national", "nacional"}, "background:#bf0411; color:#fff;") |
|||
ESP:addTypesAsColor({"autonomica1", "autonómica1"}, "background:#E96310; color:#000;") |
|||
ESP:addTypesAsColor({"autonomica2", "autonómica2"}, "background:#5D3F0F; color:#fff;") |
|||
ESP:addTypesAsColor({"autonomica3", "autonómica3"}, "background:#F4B70D; color:#000;") |
|||
colors.ESP = ESP |
colors.ESP = ESP |
||
end -- Spain |
end -- Spain |
||
पङ्क्ति २१५: | पङ्क्ति ३०३: | ||
colors.CHE = CHE |
colors.CHE = CHE |
||
end -- Switzerland |
end -- Switzerland |
||
do -- Thailand |
|||
local THA = Country:new{default = "background:#006A4D; color:#fff;"} |
|||
THA:addTypesAsColor({"AH", "T"}, "background:#003F87; color:#fff;") |
|||
colors.THA = THA |
|||
end -- Thailand |
|||
do -- Turkey |
do -- Turkey |
||
local TUR = Country:new{default = "background:#006A4D; color:#fff;"} |
local TUR = Country:new{default = "background:#006A4D; color:#fff;"} |
||
TUR:addTypesAsColor({"state", "D"}, "background:#003F87; color:#fff;") |
TUR:addTypesAsColor({"state", "D"}, "background:#003F87; color:#fff;") |
||
TUR:addTypesAsColor({"E"}, "background:#08842C; color:#fff;") |
|||
colors.TUR = TUR |
colors.TUR = TUR |
||
end -- Turkey |
end -- Turkey |
||
do -- Ukraine |
|||
local UKR = Country:new{default = "background:#0000cc; color:#fff;"} |
|||
UKR:addTypesAsColor({"E"}, "background:#009900; color:#fff;") |
|||
colors.UKR = UKR |
|||
end -- Ukraine |
|||
do -- United Kingdom |
|||
local GBR = Country:new{default = "background:#fff; border:2px solid #000;"} |
|||
GBR:addTypesAsColor({"M", "Motorway", "AM", "MNamed"}, "background:#0079C1; color:#fff;") |
|||
GBR:addTypesAsColor({"A", "Primary"}, "background:#00703C; color:#FFD200;") |
|||
colors.GBR = GBR |
|||
end -- United Kingdom |
|||
do -- United States |
do -- United States |
||
local USA = Country:new{default = "background:#006A4D; color: |
local USA = Country:new{default = "background:#006A4D; color:#fff;"} |
||
USA:addTypesAsColor({"FFH", "FR", "NER", "Rec", "RE", "Park"}, "background:#704214; color: |
USA:addTypesAsColor({"FFH", "FR", "NER", "Rec", "RE", "Park", "Pkwy", "NSB", "NFSB", "FSB", "Scenic", "SB", "Post", "Postal"}, "background:#704214; color:#fff;") |
||
colors.USA = USA |
colors.USA = USA |
||
end -- United States |
end -- United States |
||
पङ्क्ति २३१: | पङ्क्ति ३३६: | ||
colors["const"] = "background:#fc6;" |
colors["const"] = "background:#fc6;" |
||
colors["uc"] = "background:#fc6;" |
colors["uc"] = "background:#fc6;" |
||
colors["historic"] = "background:#704214; color: |
colors["historic"] = "background:#704214; color:#fff;" |
||
colors["historical"] = "background:#704214; color: |
colors["historical"] = "background:#704214; color:#fff;" |
||
colors["hist"] = "background:#704214; color: |
colors["hist"] = "background:#704214; color:#fff;" |
||
colors["scenic"] = "background:#704214; color: |
colors["scenic"] = "background:#704214; color:#fff;" |
||
colors["decommissioned"] = "background:#AAA;" |
colors["decommissioned"] = "background:#AAA;" |
||
colors["former"] = "background:#AAA;" |
colors["former"] = "background:#AAA;" |
||
colors["motorway"] = "background:#003DA5; color:#fff;" --for Norway only |
|||
end -- Built-in header types |
end -- Built-in header types |
||
end |
end |
२२:२२, ७ जुलाई २०२४ जस्तै गरी पुनरावलोकन
local p = {}
Country = {}
function Country:new(obj)
obj = obj or {}
setmetatable(obj, self)
self.__index = self
return obj
end
function Country:color(args)
local type = args.type
return self[type] or self.default
end
function Country:addTypesAsColor(types, color)
for i,type in pairs(types) do
self[type] = color
end
end
local colors = {}
do
function colors:color(args)
local headerType = args.headerType
local countryArg = args.country
local headerTypeColor = self[headerType]
if headerTypeColor then return headerTypeColor end
local success, country = pcall(self.country, self, countryArg)
if not(success) then
return 'background:#cedff2;'
else
return country:color(args)
end
end
function colors:country(name)
local color = self[name]
if color then return color end
if name == 'CAN' then
local module = require(string.format("Module:Infobox road/color/%s", name))
return module.colors
else
error("Country not included", 0)
end
end
do -- Single-color countries
colors.ARG = Country:new{default = "background:#006A4D; color:#fff;"}
colors.BEL = Country:new{default = "background:#005b8c; color:#fff;"}
colors.BGD = Country:new{default = "background:#2C6700; color:#fff;"}
colors.BOL = Country:new{default = "background:#006A4D; color:#fff;"}
colors.CHL = Country:new{default = "background:#006A4D; color:#fff;"}
colors.CHN = Country:new{default = "background:#006A4D; color:#fff;"}
colors.CRI = Country:new{default = "background:#006A4D; color:#fff;"}
colors.ECU = Country:new{default = "background:#006A4D; color:#fff;"}
colors.EST = Country:new{default = "background:#0079C1; color:#fff;"}
colors.EUR = Country:new{default = "background:#08842C; color:#fff;"}
colors.IND = Country:new{default = "background:#128807; color:#fff;"}
colors.JOR = Country:new{default = "background:#0079C1; color:#fff;"}
colors.HKG = Country:new{default = "background:#006A4D; color:#fff;"}
colors.ISL = Country:new{default = "background:#FFD200; border:2px solid #000;"}
colors.MEX = Country:new{default = "background:#006A4D; color:#fff;"}
colors.NZL = Country:new{default = "background:#006A4D; color:#fff;"}
colors.SWE = Country:new{default = "background:#003F87; color:#fff;"}
colors.URY = Country:new{default = "background:#006A4D; color:#fff;"}
colors.VNM = Country:new{default = "background:#003399; color:#fff;"}
end -- Single-color countries
do -- Multi-color countries
do -- Albania
local ALB = Country:new{default = "background:#00408B; color:#fff;"}
ALB:addTypesAsColor({"A"}, "background:#08842C; color:#fff;")
colors.ALB = ALB
end -- Albania
do -- UAE
local ARE = Country:new{default = "background:#008033; color:#fff;"}
ARE:addTypesAsColor({"E"}, "background:#0044aa; color:#fff;")
colors.ARE = ARE
end -- UAE
do -- Asian Highway Network
local ASIA = Country:new{default = "background:#fff; border:2px solid #000;"}
ASIA:addTypesAsColor({"AH"}, "background:#1e2c76; color:#fff;")
colors.ASIA = ASIA
end -- Asian Highway Network
do -- Australia
local AUS = Country:new{default = "background:#3A7119; color:#FFE133;"}
AUS:addTypesAsColor({"freeway"}, "background:#D2E2F9;")
AUS:addTypesAsColor({"highway", "city highway"}, "background:#E9F9D2;")
AUS:addTypesAsColor({"road", "rural road"}, "background:#FFFFE0;")
AUS:addTypesAsColor({"street"}, "background:#F9E2D2;")
AUS:addTypesAsColor({"track"}, "background:#fee8ab;")
colors.AUS = AUS
end -- Australia
do -- Austria
local AUT = Country:new{default = "background:#fff; border:2px solid #000;"}
AUT:addTypesAsColor({"A", "S", "B"}, "background:#276FB7; color:#fff;")
colors.AUT = AUT
end -- Austria
do -- Bosnia and Herzegovina
local BIH = Country:new{default = "background:#0B8F4B; color:#fff;"}
BIH:addTypesAsColor({"M", "B"}, "background:#0066CC; color:#fff;")
BIH:addTypesAsColor({"R"}, "background:#FFCC33; border:2px solid #000;")
colors.BIH = BIH
end -- Bulgaria
do -- Bulgaria
local BGR = Country:new{default = "background:#003F87; color:#fff;"}
BGR:addTypesAsColor({"A"}, "background:#006A4D; color:#fff;")
colors.BGR = BGR
end -- Bulgaria
do -- Croatia
local HRV = Country:new{default = "background:#cedff2;"}
HRV:addTypesAsColor({"E", "A"}, "background:#08842C; color:#fff;")
HRV:addTypesAsColor({"D"}, "background:#0066CC; color:#fff;")
HRV:addTypesAsColor({"Z"}, "background:#FFCC33;")
colors.HRV = HRV
end -- Croatia
do -- Cyprus
local CYP = Country:new{default = "background:#003F87; color:#FFC000;"}
CYP:addTypesAsColor({"A"}, "background:#005024; color:#FFC000;")
colors.CYP = CYP
end -- Cyprus
do -- Czech Republic
local CZE = Country:new{default = "background:#003F87; color:#fff;"}
CZE:addTypesAsColor({"D", "R"}, "background:#006A4D; color:#fff;")
colors.CZE = CZE
end -- Czech Republic
do -- Denmark
local DNK = Country:new{default = "background:#039; color:#fff;"}
DNK:addTypesAsColor({"E", "M"}, "background:#006A4D; color:#fff;")
DNK:addTypesAsColor({"S"}, "background:#fff; border:2px solid #af1e2d; color:#af1e2d;")
colors.DNK = DNK
end -- Denmark
do -- Finland
local FIN = Country:new{default = "background:#005eb8; color:#fff;"}
FIN:addTypesAsColor({"E"}, "background:#009775; color:#fff;")
colors.FIN = FIN
end -- Finland
do -- France
local FRA = Country:new{default = "background:#fff; border:2px solid #000;"}
FRA:addTypesAsColor({"A"}, "background:#0079C1; color:#fff;")
FRA:addTypesAsColor({"N"}, "background:#006A4D; color:#fff;")
FRA:addTypesAsColor({"E"}, "background:#28961e; color:#fff;")
colors.FRA = FRA
colors.MTQ = FRA
colors.DZA = FRA
end -- France
do -- Georgia
local GEO = Country:new{default = "background:#cedff2;"}
GEO:addTypesAsColor({"A", "International"}, "background:#039; color:#fff;")
colors.GEO = GEO
end -- Georgia
do -- Germany
local DEU = Country:new{default = "background:#cedff2;"}
DEU:addTypesAsColor({"A", "Autobahn"}, "background:#003ABD; color:#fff;")
DEU:addTypesAsColor({"B", "Bundesstraße", "Bundesstrasse"}, "background:#FC3;")
DEU:addTypesAsColor({"E"}, "background:#08842C; color:#fff;")
DEU:addTypesAsColor({"Scenic"}, "background:#633A34; color:#fff;")
colors.DEU = DEU
end -- Germany
do -- Ghana
local GHA = Country:new{default = "background:#006A4D; color:#fff;"}
GHA:addTypesAsColor({"N"}, "background:#0079C1; color:#fff;")
colors.GHA = GHA
end -- Ghana
do -- Greece
local GRC = Country:new{default = "background:#0079C1; color:#fff;"}
GRC:addTypesAsColor({"A"}, "background:#006A4D; color:#fff;")
colors.GRC = GRC
end -- Greece
do -- Hungary
local HUN = Country:new{default = "background:#006A4D; color:#fff;"}
HUN:addTypesAsColor({"M"}, "background:#0079C1; color:#fff;")
colors.HUN = HUN
end -- Hungary
do -- Iran
local IRN = Country:new{default = "background:#cedff2;"}
IRN:addTypesAsColor({"freeway"}, "background:#0079C1; color:#fff;")
IRN:addTypesAsColor({"expressway", "road"}, "background:#00703C; color:#fff;")
IRN:addTypesAsColor({"boulevard", "street"}, "background:#fff; color:#000;")
colors.IRN = IRN
end -- Iran
do -- Republic of Ireland
local IRL = Country:new{default = "background:#cedff2;"}
IRL:addTypesAsColor({"M"}, "background:#0079C1; color:#fff;")
IRL:addTypesAsColor({"N"}, "background:#00703C; color:#FFD200;")
IRL:addTypesAsColor({"R"}, "background:#fff; border:2px solid #000;")
colors.IRL = IRL
end -- Republic of Ireland
do -- Isle of Man
local IMN = Country:new{default = "background:#fff; border:2px solid #000;"}
IMN:addTypesAsColor({"A", "Primary"}, "background:#00703C; color:#FFD200;")
colors.IMN = IMN
end -- Isle of Man
do -- Israel
local ISR = Country:new{default = "background:#007E00; color:#fff;"}
ISR:addTypesAsColor({"Fwy", "Freeway", "Dual"}, "background:#0000FE; color:#fff;")
colors.ISR = ISR
end -- Israel
do -- Italy
local ITA = Country:new{default = "background:#cedff2;"}
ITA:addTypesAsColor({"A"}, "background:#08842C; color:#fff;")
ITA:addTypesAsColor({"RA"}, "background:#08842C; color:#fff;")
ITA:addTypesAsColor({"SS"}, "background:#003F87; color:#fff;")
ITA:addTypesAsColor({"E"}, "background:#08842C; color:#fff;")
colors.ITA = ITA
end -- Italy
do -- Jamaica
local JAM = Country:new{default = "background:#00703C; color:#fff;"}
JAM:addTypesAsColor({"T"}, "background:#0079C1; color:#fff;")
colors.JAM = JAM
end -- Jamaica
do -- Kosovo
local KOS = Country:new{default = "background:#0066cc; color:#fff;"}
KOS:addTypesAsColor({"R"}, "background:#009933; color:#fff;")
KOS:addTypesAsColor({"E"}, "background:#08842C; color:#fff;")
colors.KOS = KOS
end -- Kosovo
do -- Nepal
local NPL = Country:new{default = "background:#fff; border:2px solid #000;"}
-- NPL:addTypesAsColor({"M", "Motorway", "AM", "MNamed"}, "background:#0079C1; color:#fff;")
NPL:addTypesAsColor({"H"}, "background:#00703C; color:#fff;")
colors.NPL = NPL
end -- Nepal
do -- Netherlands
local NLD = Country:new{default = "background:#0079C1; color:#fff;"}
NLD:addTypesAsColor({"E"}, "background:#08842C; color:#fff;")
colors.NLD = NLD
end -- Netherlands
do -- Norway
local NOR = Country:new{default = "background:#F2A900;"}
NOR:addTypesAsColor({"E"}, "background:#00965E; color:#fff;")
colors.NOR = NOR
end -- Norway
do -- Northern Ireland
local NIR = Country:new{default = "background:#fff; border:2px solid #000;"}
NIR:addTypesAsColor({"M", "Motorway", "AM", "MNamed"}, "background:#0079C1; color:#fff;")
NIR:addTypesAsColor({"A", "Primary"}, "background:#00703C; color:#FFD200;")
colors.NIR = NIR
end -- Northern Ireland
do -- Malaysia
local MYS = Country:new{default = "background:#0079C1; color:#fff;"}
MYS:addTypesAsColor({"E"}, "background:#006A4D; color:#fff;")
colors.MYS = MYS
end -- Malaysia
do -- Morocco
local MAR = Country:new{default = "background:#fff; border:2px solid #000;"}
MAR:addTypesAsColor({"A"}, "background:#0079C1; color:#fff;")
MAR:addTypesAsColor({"Motorway"}, "background:#0079C1; color:#fff;")
colors.MAR = MAR
end -- Morocco
do -- Pakistan
local PAK = Country:new{default = "background:#0066cc; color:#fff;"}
PAK:addTypesAsColor({"M"}, "background:#22B14C; color:#fff;")
PAK:addTypesAsColor({"E"}, "background:#F5C31D; color:#000;")
colors.PAK = PAK
end -- Pakistan
do -- Philippines
local PHL = Country:new{default = "background:#093; color:#fff;"}
PHL:addTypesAsColor({"AH", "Asian Highway"}, "background:#1e2c76; color:#fff;")
colors.PHL = PHL
end -- Philippines
do -- Poland
local POL = Country:new{default = "background:#006A4D; color:#fff;"}
POL:addTypesAsColor({"A", "S"}, "background:#0079C1; color:#fff;")
colors.POL = POL
end --Poland
do -- Russia
local RUS = Country:new{default = "background:#0d69e1; color:#fff;"}
RUS:addTypesAsColor({"E"}, "background:#00a500; color:#fff;")
RUS:addTypesAsColor({"AH"}, "background:#00004e; color:#fff;")
colors.RUS = RUS
end --Russia
do -- Slovakia
local SVK = Country:new{default = "background:#0079C1; color:#fff;"}
SVK:addTypesAsColor({"D", "R"}, "background:#006A4D; color:#fff;")
colors.SVK = SVK
end -- Slovakia
do -- South Africa
local ZAF = Country:new{default = "background:#006A4D; color:#fff;"}
ZAF:addTypesAsColor({"M", "N"}, "background:#0079C1; color:#fff;")
colors.ZAF = ZAF
end -- South Africa
do -- Spain
local ESP = Country:new{default = "background:#E8E8E8;"}
ESP:addTypesAsColor({"E"}, "background:#13926C; color:#fff;")
ESP:addTypesAsColor({"A", "AP", "R", "Autovia", "Autovía", "Autopista", "autovia", "autovía", "autopista"}, "background:#19408B; color:#fff;")
ESP:addTypesAsColor({"N", "national", "nacional"}, "background:#bf0411; color:#fff;")
ESP:addTypesAsColor({"autonomica1", "autonómica1"}, "background:#E96310; color:#000;")
ESP:addTypesAsColor({"autonomica2", "autonómica2"}, "background:#5D3F0F; color:#fff;")
ESP:addTypesAsColor({"autonomica3", "autonómica3"}, "background:#F4B70D; color:#000;")
colors.ESP = ESP
end -- Spain
do -- Sri Lanka
local LKA = Country:new{default = "background:#006A4D; color:#fff;"}
LKA:addTypesAsColor({"E"}, "background:#0079C1; color:#fff;")
LKA:addTypesAsColor({"A"}, "background:#006A4D; color:#fff;")
colors.LKA = LKA
end -- Sri Lanka
do -- Switzerland
local CHE = Country:new{default = "background:#cedff2;"}
CHE:addTypesAsColor({"E"}, "background:#08842C; color:#fff;")
colors.CHE = CHE
end -- Switzerland
do -- Thailand
local THA = Country:new{default = "background:#006A4D; color:#fff;"}
THA:addTypesAsColor({"AH", "T"}, "background:#003F87; color:#fff;")
colors.THA = THA
end -- Thailand
do -- Turkey
local TUR = Country:new{default = "background:#006A4D; color:#fff;"}
TUR:addTypesAsColor({"state", "D"}, "background:#003F87; color:#fff;")
TUR:addTypesAsColor({"E"}, "background:#08842C; color:#fff;")
colors.TUR = TUR
end -- Turkey
do -- Ukraine
local UKR = Country:new{default = "background:#0000cc; color:#fff;"}
UKR:addTypesAsColor({"E"}, "background:#009900; color:#fff;")
colors.UKR = UKR
end -- Ukraine
do -- United Kingdom
local GBR = Country:new{default = "background:#fff; border:2px solid #000;"}
GBR:addTypesAsColor({"M", "Motorway", "AM", "MNamed"}, "background:#0079C1; color:#fff;")
GBR:addTypesAsColor({"A", "Primary"}, "background:#00703C; color:#FFD200;")
colors.GBR = GBR
end -- United Kingdom
do -- United States
local USA = Country:new{default = "background:#006A4D; color:#fff;"}
USA:addTypesAsColor({"FFH", "FR", "NER", "Rec", "RE", "Park", "Pkwy", "NSB", "NFSB", "FSB", "Scenic", "SB", "Post", "Postal"}, "background:#704214; color:#fff;")
colors.USA = USA
end -- United States
end -- Multi-color countries
do -- Built-in header types
colors["under construction"] = "background:#fc6;"
colors["const"] = "background:#fc6;"
colors["uc"] = "background:#fc6;"
colors["historic"] = "background:#704214; color:#fff;"
colors["historical"] = "background:#704214; color:#fff;"
colors["hist"] = "background:#704214; color:#fff;"
colors["scenic"] = "background:#704214; color:#fff;"
colors["decommissioned"] = "background:#AAA;"
colors["former"] = "background:#AAA;"
colors["motorway"] = "background:#003DA5; color:#fff;" --for Norway only
end -- Built-in header types
end
function p._color(args)
return colors:color(args)
end
function p.color(frame)
local pframe = frame:getParent()
local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself
local args = pframe.args -- the arguments passed TO the template, in the wikitext that transcludes the template
local function emptyParam(param)
local empty = {[''] = true, ['¬'] = true}
if not(param) or empty[param] then
return nil
else
return param
end
end
local state = config.state or args.state
state = emptyParam(state)
local province = config.province or args.province
province = emptyParam(province)
local type = config.type or args.type
local subtype = config.subtype or args.subtype or nil
local headerType = args.header_type or config.header_type
headerType = emptyParam(headerType)
if headerType then
headerType = string.lower(headerType)
end
local countryArg = config.country or args.country
countryArg = emptyParam(countryArg)
local country = countryArg
if not(country) then
if colors[headerType] then
country = ''
else
local stateParam = state or province
if not(stateParam) then
country = ''
else
local countryMask = require "Module:Infobox road/meta/mask/country"
country = countryMask._country(stateParam, countryArg)
end
end
end
return p._color{country=country, state=state, province=province, type=type, subtype=subtype, headerType=headerType}
end
return p