Jump to content

Module:Repeat: Difference between revisions

no edit summary
(from PCBA)
No edit summary
 
(11 intermediate revisions by the same user not shown)
Line 53:
end
range = range .. arglist[argcount] .. " 100%"
return "linear-gradient(to "..direction..", ".. range ..") no-repeat"
end
 
function utils.parentGradient(frame)
local count = 1
local args = frame:getParent().args
local direction = args["direction"] or "left"
local param = args[1]
while param ~= nil do
count = count + 1
param = args[count]
end
local range = args[1] .. ", "
for i=1,(count-2) do
local x = string.format("%.1f",100 * ((i)/(count-1))).. "% "
range = range .. args[i] .. " ".. x .. ", "
range = range .. args[i + 1] .. " " .. x .. ", "
end
range = range .. args[count-1] .. " 100%"
return "linear-gradient(to "..direction..", ".. range ..") no-repeat"
end
Cookies help us deliver our services. By using our services, you agree to our use of cookies.