Editing Module:Color

Warning: You are not logged in. Once you make an edit, a temporary account will be created for you. Learn more. Log in or create an account to continue receiving notifications after this account expires, and to access other features.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision Your text
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"] = {
["CitadelCategoryWeapon"] = { -- weapon
        hex = "d5903f",
hex = "c97a03",
        rgb = "213,144,63",
rgb = "201,122,3",
        hsl = "30,70%,54%",
hsl = "35,97%,40%",
        cmyk = "0%,32%,70%,16%"
cmyk = "0%,39%,98%,21%"
    },
},
["CitadelCategoryArmor"] = {
["CitadelCategoryArmor"] = { --vitality
        hex = "74b01c",
hex = "659818",
        rgb = "116,176,28",
rgb = "101,152,24",
        hsl = "88,73%,40%",
hsl = "82,73%,34%",
        cmyk = "34%,0%,84%,31%"
cmyk = "34%,0%,84%,40%"
    },
},
["CitadelCategoryTech"] = { --spirit
["CitadelCategoryTech"] = { --spirit
hex = "c288f0", -- purple
hex = "c288f0", -- purple
Line 22: Line 21:
cmyk = "19%,43%,0%,6%"
cmyk = "19%,43%,0%,6%"
},
},
["Citadel_LaneStats_Souls"] = {
["Souls"] = {
         hex = "98ffde",
         hex = "98ffde",
         rgb = "152,255,222",
         rgb = "152,255,222",
Line 28: Line 27:
         cmyk = "40%,0%,13%,0%"
         cmyk = "40%,0%,13%,0%"
     },
     },
     ["Citadel_Profile_Stats_Healing"] = {
     ["Healing"] = {
         hex = "00FF9A",
         hex = "00FF9A",
         rgb = "0,255,154",
         rgb = "0,255,154",
Line 147: Line 146:
"CitadelCategoryArmor",
"CitadelCategoryArmor",
"CitadelCategoryTech",
"CitadelCategoryTech",
"Citadel_LaneStats_Souls",
"Souls",
"Citadel_Profile_Stats_Healing",
"Healing",
"hero_atlas",
"hero_atlas",
"hero_wraith",
"hero_wraith",
Line 209: Line 208:
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 253: Line 247:
-- Add headers
-- Add headers
local headers = {"Key", "English", "Hex Code", "Colored div", "Colored Text", "Colored Underline"}
local headers = {"Key", "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 264: Line 258:
local row
local row
for i, key in ipairs(colors_order) do
for i, key in ipairs(colors_order) do
local color_data = colors_data[key]
local hex = colors_data[key]['hex']
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>"
Please note that all contributions to The Deadlock Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see Deadlock:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)
Preview page with this template