Pokémon GO Wiki

We've Moved! Just as Gamepedia has joined forces with Fandom, this wiki had joined forces with our Fandom equivalent. The wiki has been archived and we ask that readers and editors move to the now combined wiki on Fandom. Click to go to the new wiki.

READ MORE

Pokémon GO Wiki
Advertisement

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

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,'<div style="display:inline-block;border-radius: 2em; width:4em; background:'..types[typeLow].backcolor..'; border: 1px solid '..types[typeLow].forecolor..'; text-shadow:0 0 1px black;padding:0 0.3em; text-align:center;position:relative;height: 1.5em;color:white">[['..ptype..'|<span style="position:absolute;width:100%;height:100%;top:0;left:0;z-index:1;"></span>]]'..ptype..'</div>')
    end
  end
  return table.concat(returnhtml,' ')
end
return p
Advertisement