League of Legends Wiki

Want to contribute to this wiki?
Sign up for an account, and get started!
You can even turn off ads in your preferences.

Come join the LoL Wiki community Discord server!

READ MORE

League of Legends Wiki
Register
Advertisement

Documentation for this module may be created at Module:Color/doc

-- Used by [[Template:Keyword color]] and [[Template:Skin tier]]
local p = {}
local lib = require('Module:Feature')

local keywordcolor = {
-- lol
    {"health",					"#1F995C"},
    {"hp",						"#1F995C"},
	
-- Test
	{"haste",					"#FFFDC9"},
	{"ah",						"#FFFDC9"},

-- TFT

	{"radiant",				   "#EABE3F"},
	
	
    {"attack damage",          "orange"},
    {"attack's damage",        "orange"},
    {"ad",                     "orange"},
    {"physical damage",        "#FF8C34"},
    {"pd",                     "#FF8C34"},
    {"ability power",          "#7A6DFF"},
    {"ap",                     "#7A6DFF"},
    {"magic damage",           "#00B0F0"},
    {"md",                     "#00B0F0"},
    {"true damage",            "#F9966B"}, -- used to dodge percent
    {"td",                     "#F9966B"},    
    {"armor",                  "yellow"},
    {"armor penetration",      "tomato"},
    {"lethality",              "tomato"},
    {"omnivamp",               "#CC2051"},
    {"leech",                  "#CC2051"},
    {"life steal",             "#CC2051"},
    {"ls",                     "#CC2051"},
    {"magic resist",           "#00FFFF"},
    {"mr",                     "#00FFFF"},
    {"resist",                 "#00FFFF"},
    {"magic penetration",      "turquoise"},
    {"mana",                   "#0099CC"},
    {"energy",                 "yellow"},
    {"critical strike chance", "orangered"},
    {"critical chance",        "orangered"},
    {"critical strike damage", "orangered"},
    {"critical damage",        "#944B00"},
    {"crit",                   "#944B00"},    
    {"movement speed",         "#F5EE99"},
    {"move speed",             "#F5EE99"},
    {"ms",                     "#F5EE99"},
    {"xp",                     "#883FD1"},
    {"gold",                   "#FFD700"},
    {"siphoning strike",       "#594BDD"},
    {"soul",                   "#5C58C9"},
    {"buzzword4",              "#BB76AC"},
    {"buzzword3",              "#E34D4C"},
    {"buzzword2",              "#56C456"},
    {"buzzword",               "#AF1AAF"},
    {"mist",                   "#26DFB0"},
    {"wild",                   "#A01D7A"},
    {"placed",                 "#883FD1"},
    {"attack speed",           "orangered"},
    {"as",                     "orangered"},
    {"fury",                   "#FA6533"},
    {"river",                  "#43D9FB"},
    {"terrain",                "#B36F21"},
    {"brush",                  "#96FB97"},
    {"life point",             "#56C456"},
    {"main",                   "#CA2697"},
    {"off%-hand",              "#E34D4C"},
    {"sweetspot",              "#E34D4C"},
    {"exalted",                "#FF7F00"},
    {"steel",                  "#748DD0"},
    {"azakana",                "#E34D4C"},
    {"stardust",               "#4262F0"},
-- rk
    {"overcharge",             "deeppink"},
-- Blurbs for now
	{"heal",					"#60E08F"},
	{"range",					"#FFFDC9"},
	
    {"ar",                     "yellow"},

}

local skincolor = {
    {"ultimate",               "#FFA500"}, -- orange
    {"3250",                   "#FFA500"}, -- orange
    {"2775",                   "#FFA500"}, -- orange
    {"legendary",              "#FF3232"},
    {"1820",                   "#FF3232"},
    {"loot",                   "#7943ED"},
    {"gem",                    "#7943ED"},
    {"mythic",                 "#7943ED"},
    {"2450",                   "#7943ED"},
    {"10",                     "#7943ED"},
    {"epic",                   "#00C8FF"},
    {"1350",                   "#00C8FF"},
    {"standard",               "#228B22"}, -- forestgreen
    {"superior",               "#228B22"}, -- forestgreen
    {"975",                    "#228B22"}, -- forestgreen
    {"budget",                 "#FFFFFF"}, -- white
    {"deluxe",                 "#FFFFFF"}, -- white
    {"750",                    "#FFFFFF"}, -- white
    {"classic",                "#808080"}, -- grey
    {"timeworn",               "#808080"}, -- grey
    {"520",                    "#808080"}, -- grey
    {"460",                    "#808080"}, -- grey
    {"390",                    "#808080"}, -- grey
    {"chroma",                 "#FFFFFF"}, -- white
    {"290",                    "#FFFFFF"}, -- white
    {"195",                    "#FFFFFF"}  -- white
}

function p.keyword(frame)
    local args = lib.frameArguments(frame)
	local text = string.lower(args[1]):gsub('<.->', '')
	
    for _, color in ipairs(keywordcolor) do 
        local result = string.find(text, color[1])

        if result ~= nil then
            return color[2]
        end
    end

    return "inherit"
end
 
function p.skin(frame)
    local args = lib.frameArguments(frame)
 
    for _, color in ipairs(skincolor) do 
        local result = string.find(string.lower(args[1]), color[1])

        if result ~= nil then
            return color[2]
        end
    end

    return "inherit"
end
 
return p
Advertisement