Module:Color

From Overwatch Wiki
Revision as of 04:08, 8 May 2020 by MomoRuns (talk | contribs) (Created page with "local p = {} local colors = mw.loadData('Module:Color/data') local getArgs = require('Module:Arguments').getArgs function p.main(frame) local args = getArgs(frame, { w...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Template-info.png Documentation

Module:Color/data


local p = {}
local colors = mw.loadData('Module:Color/data')
local getArgs = require('Module:Arguments').getArgs


function p.main(frame)
  local args = getArgs(frame, {
    wrappers = {
      'Template:Color'
    }
  })

  local success, result = pcall(p._main, args)
  if success then
    return mw.text.nowiki(result)
  end
end

function p._main(args)
  assert(args[1], 'Missing input')
  return colors[args[1]:lower()] or args[1]
end


return p