Module:Color

-- -- Used by Template:Keyword color and Template:Skin tier local p = {} local lib = require('Module:Feature') local keywordcolor = { {"health",               "#C03300"}, {"hp",                   "#C03300"}, {"attack damage",        "#FC8A01"}, {"attack's damage",      "#FC8A01"}, {"ad",                   "#FC8A01"}, {"physical damage",      "#FC8A01"}, {"ability power",        "#97FC97"}, {"ap",                   "#97FC97"}, {"magic damage",         "#97FC97"}, {"true damage",          "#F9966B"}, -- used to dodge percent {"attack speed",         "#C80000"}, {"armor",                "#EFF002"}, {"lethality",            "#EFF002"}, {"magic resist",         "#CA1F7B"}, {"mr",                   "#CA1F7B"}, {"resist",               "#E46E9D"}, {"mana",                 "#0099CC"}, {"energy",               "#FFFF00"}, {"critical strike chance","#E56013"}, {"critical chance",      "#E56013"}, {"critical strike damage","#944B00"}, {"critical damage",      "#944B00"}, {"movement speed",       "#F5EE99"}, {"ms",                   "#F5EE99"}, {"xp",                   "#883FD1"}, {"gold",                 "#FFD700"}, {"siphoning strike",     "#5C58C9"}, {"buzzword3",            "#E34D4C"}, {"buzzword2",            "#56C456"}, {"buzzword",             "#A01D7A"} }

local skincolor = { {"ultimate",             "orange"}, {"3250",                 "orange"}, {"2775",                 "orange"}, {"legendary",            "#FF3232"}, {"1820",                 "#FF3232"}, {"loot",                 "#7943ED"}, {"gem",                  "#7943ED"}, {"mythic",               "#7943ED"}, {"2450",                 "#7943ED"}, {"10",                   "#7943ED"}, {"epic",                 "#00C8FF"}, {"1350",                 "#00C8FF"}, {"standard",             "#ForestGreen"}, {"975",                  "#ForestGreen"}, {"budget",               "#White"}, {"750",                  "#White"}, {"classic",              "#Grey"}, {"520",                  "#Grey"}, {"460",                  "#Grey"}, {"390",                  "#Grey"}, {"chroma",               "#White"}, {"290",                  "#White"}, {"195",                  "#White"} }

function p.keyword(frame) local args; if frame.args == nil then args = lib.arguments(frame) else args = lib.arguments(frame.args) end for i,color in ipairs(keywordcolor) do        result = mw.ustring.find(mw.ustring.lower(args[1]), color[1]) if result ~= nil then return color[2] end end return "inherit" end function p.skin(frame) local args; if frame.args == nil then args = lib.arguments(frame) else args = lib.arguments(frame.args) end for i,color in ipairs(skincolor) do        result = mw.ustring.find(mw.ustring.lower(args[1]), color[1]) if result ~= nil then return color[2] end end return "inherit" end return p -- --