Module:Type

local p = {} function p.typeformat( f ) local args = f:getParent.args local types = { ["normal"] = { ["forecolor"] = "#5e6062", ["backcolor"] = "#868886" },   ["fire"] = { ["forecolor"] = "#f06818", ["backcolor"] = "#fba130" },   ["fighting"] = { ["forecolor"] = "#a82f2a", ["backcolor"] = "#d14d62" },   ["water"] = { ["forecolor"] = "#3371c6", ["backcolor"] = "#60a5d9" },   ["flying"] = { ["forecolor"] = "#5456ab", ["backcolor"] = "#7785d9" },   ["grass"] = { ["forecolor"] = "#1e7057", ["backcolor"] = "#43bb66" },   ["poison"] = { ["forecolor"] = "#ad2c9e", ["backcolor"] = "#d746c3" },   ["electric"] = { ["forecolor"] = "#e29c15", ["backcolor"] = "#fccf36" },   ["ground"] = { ["forecolor"] = "#a53f10", ["backcolor"] = "#ca7338" },   ["psychic"] = { ["forecolor"] = "#e8264e", ["backcolor"] = "#fc7066" },   ["rock"] = { ["forecolor"] = "#94966c", ["backcolor"] = "#c7b966" },   ["ice"] = { ["forecolor"] = "#167179", ["backcolor"] = "#6bccc4" },   ["bug"] = { ["forecolor"] = "#479d06", ["backcolor"] = "#77c10c" },   ["dragon"] = { ["forecolor"] = "#275799", ["backcolor"] = "#2f69b6" },   ["ghost"] = { ["forecolor"] = "#733fb7", ["backcolor"] = "#816dc5" },   ["dark"] = { ["forecolor"] = "#3b334d", ["backcolor"] = "#575565" },   ["steel"] = { ["forecolor"] = "#256473", ["backcolor"] = "#347a8f" },   ["fairy"] = { ["forecolor"] = "#cf44a9", ["backcolor"] = "#f38dd8" } }

local returnhtml, typeLow = {}, ''

for _,ptype in ipairs(args) do   typeLow = string.lower(ptype) if types[typeLow] ~= nil then table.insert(returnhtml,' '..ptype..' ') end end return table.concat(returnhtml,' ') end return p