Module:FIFA OL3/Color
跳到导航
跳到搜索
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