Module:Color: Difference between revisions

Jump to navigation Jump to search
Sur (talk | contribs)
m order added for write_previews sake
Sur (talk | contribs)
m souls and healing properly localized; added english column to write_previews
Line 1: Line 1:
local lang_module = require('Module:Lang')
local p = {}
local p = {}


Line 21: Line 22:
cmyk = "19%,43%,0%,6%"
cmyk = "19%,43%,0%,6%"
},
},
["Souls"] = {
["Citadel_LaneStats_Souls"] = {
         hex = "98ffde",
         hex = "98ffde",
         rgb = "152,255,222",
         rgb = "152,255,222",
Line 27: Line 28:
         cmyk = "40%,0%,13%,0%"
         cmyk = "40%,0%,13%,0%"
     },
     },
     ["Healing"] = {
     ["Citadel_Profile_Stats_Healing"] = {
         hex = "00FF9A",
         hex = "00FF9A",
         rgb = "0,255,154",
         rgb = "0,255,154",
Line 146: Line 147:
"CitadelCategoryArmor",
"CitadelCategoryArmor",
"CitadelCategoryTech",
"CitadelCategoryTech",
"Souls",
"Citadel_LaneStats_Souls",
"Healing",
"Citadel_Profile_Stats_Healing",
"hero_atlas",
"hero_atlas",
"hero_wraith",
"hero_wraith",
Line 247: Line 248:
-- Add headers
-- Add headers
local headers = {"Key", "Hex Code", "Colored div", "Colored Text", "Colored Underline"}
local headers = {"Key", "English", "Hex Code", "Colored div", "Colored Text", "Colored Underline"}
local header_row = ""
local header_row = ""
for _, header in ipairs(headers) do
for _, header in ipairs(headers) do
Line 258: Line 259:
local row
local row
for i, key in ipairs(colors_order) do
for i, key in ipairs(colors_order) do
local hex = colors_data[key]['hex']
local color_data = colors_data[key]
if color_data == nil then return "key " .. key .. " from colors_order is missing in colors_data" end
local hex = color_data['hex']
local english = lang_module.get_string(key, 'en')
row = ''
row = ''
row = row .. "<td>" .. key .. "</td>"
row = row .. "<td>" .. key .. "</td>"
row = row .. "<td>" .. english .. "</td>"
row = row .. "<td>" .. "#" .. hex .. "</td>"
row = row .. "<td>" .. "#" .. hex .. "</td>"
row = row .. "<td>" .. "<div style=background-color:#" .. hex .. ";>" .. key .. "</div>" .. "</td>"
row = row .. "<td>" .. "<div style=background-color:#" .. hex .. ";>" .. key .. "</div>" .. "</td>"