Modul:regnbåge
Dokumentationen för denna modul kan skapas på Modul:regnbåge/dok /test
local export = {}
function export.getWikitext(frame)
local text_args = frame:getParent().args
local text = ""
for i, c in pairs(text_args) do
text = text .. c
end
local chars = mw.ustring.gmatch(text, ".")
local colors = { "f00", "f90", "cc0", "0c0", "09f", "66f", "c0f" }
local html = ""
local index = 0
for c in chars do
if c == " " then
html = html .. " "
else
html = html .. '<span style="color:#' .. (colors[index % 7 + 1]) .. '">' .. c .. '</span>'
index = index + 1
end
end
return html
end
return export