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"] = {
["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"] = {
["Armor"] = {
        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
["Tech"] = {
hex = "c288f0", -- purple
hex = "c288f0", -- purple
rgb = "194,136,240",
rgb = "194,136,240",
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 34: Line 33:
         cmyk = "100%,0%,40%,0%"
         cmyk = "100%,0%,40%,0%"
     },
     },
     ["hero_atlas"] = { --abrams
     ["Abrams"] = {
         hex = "2193AE",
         hex = "2193AE",
         rgb = "33,147,174",
         rgb = "33,147,174",
Line 40: Line 39:
         cmyk = "81%,15%,0%,32%"
         cmyk = "81%,15%,0%,32%"
     },
     },
     ["hero_wraith"] = {  
     ["Wraith"] = {
         hex = "954E7A",
         hex = "954E7A",
         rgb = "149,78,122",
         rgb = "149,78,122",
Line 46: Line 45:
         cmyk = "0%,48%,18%,42%"
         cmyk = "0%,48%,18%,42%"
     },
     },
     ["hero_viscous"] = {
     ["Viscous"] = {
         hex = "8AC365",
         hex = "8AC365",
         rgb = "138,195,101",
         rgb = "138,195,101",
Line 52: Line 51:
         cmyk = "29%,0%,48%,24%"
         cmyk = "29%,0%,48%,24%"
     },
     },
     ["hero_orion"] = { --grey talon
     ["Grey Talon"] = {
         hex = "61B083",
         hex = "61B083",
         rgb = "97,176,131",
         rgb = "97,176,131",
Line 58: Line 57:
         cmyk = "45%,0%,26%,31%"
         cmyk = "45%,0%,26%,31%"
     },
     },
     ["hero_hornet"] = { --vindicta
     ["Vindicta"] = {
         hex = "87A8B8",
         hex = "87A8B8",
         rgb = "135,168,184",
         rgb = "135,168,184",
Line 64: Line 63:
         cmyk = "27%,9%,0%,28%"
         cmyk = "27%,9%,0%,28%"
     },
     },
     ["hero_inferno"] = { --infernus
     ["Infernus"] = {
         hex = "FF472E",
         hex = "FF472E",
         rgb = "253,71,46",
         rgb = "253,71,46",
Line 70: Line 69:
         cmyk = "0%,72%,82%,1%"
         cmyk = "0%,72%,82%,1%"
     },
     },
     ["hero_forge"] = { --mcginnis
     ["McGinnis"] = {
         hex = "466A9C",
         hex = "466A9C",
         rgb = "70,106,156",
         rgb = "70,106,156",
Line 76: Line 75:
         cmyk = "55%,32%,0%,39%"
         cmyk = "55%,32%,0%,39%"
     },
     },
     ["hero_haze"] = {
     ["Haze"] = {
         hex = "AE6231",
         hex = "AE6231",
         rgb = "174,98,49",
         rgb = "174,98,49",
Line 82: Line 81:
         cmyk = "0%,44%,72%,32%"
         cmyk = "0%,44%,72%,32%"
     },
     },
     ["hero_ghost"] = { --lady geist
     ["Lady Geist"] = {
         hex = "088A5C",
         hex = "088A5C",
         rgb = "8,138,92",
         rgb = "8,138,92",
Line 88: Line 87:
         cmyk = "94%,0%,33%,46%"
         cmyk = "94%,0%,33%,46%"
     },
     },
     ["hero_mirage"] = {
     ["Mirage"] = {
         hex = "87683C",
         hex = "87683C",
         rgb = "135,104,60",
         rgb = "135,104,60",
Line 94: Line 93:
         cmyk = "0%,23%,56%,47%"
         cmyk = "0%,23%,56%,47%"
     },
     },
     ["hero_lash"] = {
     ["Lash"] = {
         hex = "444C57",
         hex = "444C57",
         rgb = "68,76,87",
         rgb = "68,76,87",
Line 100: Line 99:
         cmyk = "22%,13%,0%,66%"
         cmyk = "22%,13%,0%,66%"
     },
     },
     ["hero_gigawatt"] = { --seven
     ["Seven"] = {
         hex = "EC963F",
         hex = "EC963F",
         rgb = "236,150,63",
         rgb = "236,150,63",
Line 106: Line 105:
         cmyk = "0%,36%,73%,8%"
         cmyk = "0%,36%,73%,8%"
     },
     },
     ["hero_yamato"] = {
     ["Yamato"] = {
         hex = "6F9181",
         hex = "6F9181",
         rgb = "111,145,129",
         rgb = "111,145,129",
Line 112: Line 111:
         cmyk = "23%,0%,11%,43%"
         cmyk = "23%,0%,11%,43%"
     },
     },
     ["hero_warden"] = {
     ["Warden"] = {
         hex = "566279",
         hex = "566279",
         rgb = "86,98,121",
         rgb = "86,98,121",
Line 118: Line 117:
         cmyk = "29%,19%,0%,53%"
         cmyk = "29%,19%,0%,53%"
     },
     },
     ["hero_bebop"] = {
     ["Bebop"] = {
         hex = "A04835",
         hex = "A04835",
         rgb = "160,72,53",
         rgb = "160,72,53",
Line 124: Line 123:
         cmyk = "0%,55%,67%,37%"
         cmyk = "0%,55%,67%,37%"
     },
     },
     ["hero_chrono"] = { --paradox
     ["Paradox"] = {
         hex = "993A53",
         hex = "993A53",
         rgb = "153,58,83",
         rgb = "153,58,83",
Line 130: Line 129:
         cmyk = "0%,62%,46%,40%"
         cmyk = "0%,62%,46%,40%"
     },
     },
     ["hero_dynamo"] = {
     ["Dynamo"] = {
         hex = "D0BA46",
         hex = "D0BA46",
         rgb = "208,186,70",
         rgb = "208,186,70",
Line 136: Line 135:
         cmyk = "0%,11%,66%,18%"
         cmyk = "0%,11%,66%,18%"
     },
     },
     ["hero_shiv"] = {
     ["Shiv"] = {
         hex = "A53D88",
         hex = "A53D88",
         rgb = "165,61,136",
         rgb = "165,61,136",
Line 142: Line 141:
         cmyk = "0%,63%,18%,35%"
         cmyk = "0%,63%,18%,35%"
     }
     }
}
local colors_order = {
"CitadelCategoryWeapon",
"CitadelCategoryArmor",
"CitadelCategoryTech",
"Citadel_LaneStats_Souls",
"Citadel_Profile_Stats_Healing",
"hero_atlas",
"hero_wraith",
"hero_viscous",
"hero_orion",
"hero_hornet",
"hero_inferno",
"hero_forge",
"hero_haze",
"hero_ghost",
"hero_mirage",
"hero_lash",
"hero_gigawatt",
"hero_yamato",
"hero_warden",
"hero_bebop",
"hero_chrono",
"hero_dynamo",
"hero_shiv"
}
}


Line 203: Line 177:
if no_wrap == nil or no_wrap == 'false' or no_wrap == "" then no_wrap = false else no_wrap = true end
if no_wrap == nil or no_wrap == 'false' or no_wrap == "" then no_wrap = false else no_wrap = true end
if debug_mode == nil or debug_mode == 'false' or debug_mode == "" then debug_mode = false end
if debug_mode == nil or debug_mode == 'false' or debug_mode == "" then debug_mode = false end
if (key == "Weapon" or
key == "Armor" or
key == "Tech") then
key = "CitadelCategory" .. key
elseif (key == "Souls") then
key = "Citadel_LaneStats_Souls"
elseif (key == "Healing") then
key = "Citadel_Profile_Stats_Healing"
end
local color_data = colors_data[slot]
local color_data = colors_data[slot]
Line 241: Line 203:
end
end


function p.list_keys(frame)
local ret = ''
for key, value in pairs(colors_data) do
ret = ret .. key .. ", "
end
return frame:preprocess(ret)
end
function p.write_previews(frame)
local ret = ''
-- Add headers
local headers = {"Key", "English", "Hex Code", "Colored div", "Colored Text", "Colored Underline"}
local header_row = ""
for _, header in ipairs(headers) do
header_row = header_row .. "<th>" .. header .. "</th>"
end
header_row = "<tr>" .. header_row .. "</tr>"
-- Add values
local rows = ""
local row
for i, key in ipairs(colors_order) do
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 .. "<td>" .. key .. "</td>"
row = row .. "<td>" .. english .. "</td>"
row = row .. "<td>" .. "#" .. hex .. "</td>"
row = row .. "<td>" .. "<div style=background-color:#" .. hex .. ";>" .. key .. "</div>" .. "</td>"
row = row .. "<td>" .. "<span style=color:#" .. hex .. ";>" .. key .. "</span>" .. "</td>"
row = row .. "<td>" .. '<span style="text-decoration: underline; text-decoration-color: #'..hex..';">' .. key .. "</span>" .. "</td>"
rows = rows .. "<tr>" .. row .. "</tr>"
end
return "<table>" .. header_row .. rows .. "</table>"
end
return p
return p
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