Module:Sandbox/User:EricAlvin/TestParse: Difference between revisions
No edit summary |
No edit summary |
||
(25 intermediate revisions by the same user not shown) | |||
Line 148: | Line 148: | ||
bordered = true | bordered = true | ||
overflowbehavior = function(f) | overflowbehavior = function(f) | ||
if #strtbl - f | if #strtbl - f <= 0 or f == 1 then return colorlist[2] else return colorlist[1] end | ||
end | end | ||
elseif type == 'chaotic' then | elseif type == 'chaotic' then | ||
Line 154: | Line 154: | ||
end | end | ||
local ci = 1 | local ci = 1 | ||
if bordered == true then | --if bordered == true then | ||
ci = 1 | --ci = 1 | ||
end | --end | ||
for i=1, #strtbl do | for i=1, #strtbl do | ||
if ci > #colorlist or ci <= 0 then | if ci > #colorlist or ci <= 0 or bordered == true then | ||
hexcolor = overflowbehavior(ci) | hexcolor = overflowbehavior(ci) | ||
else | else | ||
Line 169: | Line 169: | ||
end | end | ||
if i%interval == 0 then | if i%interval == 0 then | ||
if bordered == true then | --if bordered == true then | ||
ci = ci + 1 | --ci = ci + 1 | ||
else | --else | ||
--ci = ci + 1 | |||
end | --end | ||
ci = ci + 1 | |||
end | end | ||
end | end |