七日内新公告:全站维护公告
  • 你好~!欢迎来到萌娘百科镜像站!如需查看或编辑,请联系本站管理员注册账号。
  • 本镜像站和其他萌娘百科的镜像站无关,请注意分别。

Module:FIFA OL3/Color

猛汉♂百科,万男皆可猛的百科全书!转载请标注来源页面的网页链接,并声明引自猛汉百科。内容不可商用。
跳到导航 跳到搜索
Template-info.svg 模块文档  [创建] [刷新]
local p = {}

local getArgs = require('Module:Arguments').getArgs

function p._convert(args)
	local value = tonumber(args[1]);
	if value == nil then
		return 'black'
	end
	local combined = string.format('%03d', value);
	if combined  >= '120' then
		return '#ffff00'
	elseif combined  >= '100' then
		return '#6633ff'
	elseif combined  >= '090' then
		return '#0066cc'
	elseif combined  >= '080' then
		return '#3399cc'
	elseif combined  >= '070' then
		return 'white'
	else
		return '#336666'
	end
end

function p.convert(frame)
	local args = getArgs(frame, {wrappers='Template:FIFA OL3/Color'})
	return p._convert(args)
end

return p