Module:Color

From Overwatch Wiki
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