Module:Color: Difference between revisions

Sur (talk | contribs)
m order added for write_previews sake
Sur (talk | contribs)
m redirects for Souls and Healing to their respective key
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
local lang_module = require('Module:Lang')
local p = {}
local p = {}


-- Hash for color values
-- Hash for color values
local colors_data = {
local colors_data = {
["CitadelCategoryWeapon"] = { -- weapon
["CitadelCategoryWeapon"] = {
hex = "c97a03",
        hex = "d5903f",
rgb = "201,122,3",
        rgb = "213,144,63",
hsl = "35,97%,40%",
        hsl = "30,70%,54%",
cmyk = "0%,39%,98%,21%"
        cmyk = "0%,32%,70%,16%"
},
    },
["CitadelCategoryArmor"] = { --vitality
["CitadelCategoryArmor"] = {
hex = "659818",
        hex = "74b01c",
rgb = "101,152,24",
        rgb = "116,176,28",
hsl = "82,73%,34%",
        hsl = "88,73%,40%",
cmyk = "34%,0%,84%,40%"
        cmyk = "34%,0%,84%,31%"
},
    },
["CitadelCategoryTech"] = { --spirit
["CitadelCategoryTech"] = { --spirit
hex = "c288f0", -- purple
hex = "c288f0", -- purple
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 208: Line 209:
key == "Tech") then
key == "Tech") then
key = "CitadelCategory" .. key
key = "CitadelCategory" .. key
elseif (key == "Souls") then
key = "Citadel_LaneStats_Souls"
elseif (key == "Healing") then
key = "Citadel_Profile_Stats_Healing"
end
end
local color_data = colors_data[slot]
local color_data = colors_data[slot]
Line 247: Line 253:
-- 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 264:
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>"