Module:TableColor

local getArgs = require('Module:Arguments').getArgs local p = {}

function p.main(frame) local args = getArgs(frame) return p._main(args) end

function p._main(args) local part = args[1] local color = args[2] or "default" local code = mw.html.create

local hex = { ["border"] = { ["exbel"] = "31a44c", ["winden"] = "4AAFC8", ["tanren"] = "7e8b0f", ["undercity"] = "562951", ["archford"] = "0c5124", ["default"] = "404D86" },			["background"] = { ["exbel"] = "96D85A", ["winden"] = "88D0E8", ["tanren"] = "9fbf38", ["undercity"] = "7d577d", ["archford"] = "33A634", ["default"] = "5f72c1" },			["row"] = { ["exbel"] = "FBFEFD", ["winden"] = "EDF1C3", ["tanren"] = "C8C1C6", ["undercity"] = "562951", ["archford"] = "BDE8A6", ["default"] = "D6E1EF" },			["header"] = { ["exbel"] = "B0F078", ["winden"] = "D4E8F4", ["tanren"] = "cad854", ["undercity"] = "907a94", ["archford"] = "60CA42", ["default"] = "89a9d1" }		}

if part then part = string.lower(part) end

if color then color = string.lower(color) end

code :wikitext(hex[part][color])

return tostring(code) end

return p

-- print(p.main)