Module:Storm categories: Difference between revisions

Content deleted Content added
specificity for warnings
fix color overrides in demo
Line 13:
},
mtstorm = {
color = "00faf4", -- Old {{storm colour}} did not support. Value guessed.
name = "Moderate tropical storm",
sortkey = 105
Line 23:
},
severedep = {
color = "5ebaff", -- Old {{storm colour}} did not support. Value guessed.
name = "Severe tropical depression",
sortkey = 120
},
moddepression = {
color = "5ebaff", -- Old {{storm colour}} did not support. Value guessed.
name = "Moderate tropical depression",
sortkey = 95
Line 365:
cats["shemtc"] = cats["tropicalcyclone"]
 
-- Ambiguous color names. This is because the old {[storm colour}} itself is extremely
-- extremely ambiguous. This is also used to override the output of some codes.
local colors = {
-- Basin colors
Line 508:
local id = mw.html.create("td")
:wikitext(name)
local actualColor = p._color(name)
local colorPreview = mw.html.create("td")
:attr("style", "background-color: #" .. cat["color"]actualColor .. "; padding: 0; width: 1.8em")
local color = mw.html.create("td")
:wikitext("#" .. cat["color"]actualColor)
local catColorBlackRatio = colorRatio({ "#" .. cat["color"]actualColor, "black" });
local catColorLinkRatio = colorRatio({ "#" .. cat["color"]actualColor, "#0645ad" });
local catColorVisitedLinkRatio = colorRatio({ "#" .. cat["color"]actualColor, "#0b0080" });
if catColorBlackRatio == "?" or catColorLinkRatio == "?" or catColorVisitedLinkRatio == "?" then
color