Content deleted Content added
No edit summary |
No edit summary |
||
Line 5:
p.lengthcheck = function()
local asd = '123456789'
return string.len(
end
p.spectrum = makeInvokeFunction('_spectrum')
function p._spectrum(args)
local list = args[1]
local width = args[2] or '768'
local result = '<div style="width:' .. width .. 'px;height:20px;background:linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);"> </div>\n'
for k1, v1 in ipairs(mw.text.split(list, '\n')) do
for k2, v2 in ipairs(mw.text.split(v1, '\\')) do -- k2:Name; v2:RGB
if string.len(v2) ~= 8 then
result = result .. '<strong>Invalid RGB value. Please use RR-GG-BB format and all numbers must be converted to hexadecimal.</strong>'
else
for k3, v3 in ipairs(mw.text.split(v2, '\-')) do
result = result .. table.concat(v2)
end
end
end
end
return result
end
|