Module:DropsLineTest: Difference between revisions
Jump to navigation
Jump to search
No edit summary Tag: Reverted |
No edit summary Tag: Manual revert |
||
Line 2: | Line 2: | ||
function p.determineColor(r) | function p.determineColor(r) | ||
if tonumber(r) <= 1 then | |||
return "#afeeee" | return "#afeeee" | ||
elseif r <= 25 then | elseif tonumber(r) <= 25 then | ||
return "#56e156" | return "#56e156" | ||
elseif r <= 100 then | elseif tonumber(r) <= 100 then | ||
return "#ffed4c" | return "#ffed4c" | ||
elseif r <= 1000 then | elseif tonumber(r) <= 1000 then | ||
return "#ff863c" | return "#ff863c" | ||
elseif r <= 9999999 then | elseif tonumber(r) <= 9999999 then | ||
return "#ff6262" | return "#ff6262" | ||
else | else | ||
Line 18: | Line 17: | ||
end | end | ||
function p.determineCellStyle(r, n) | |||
function p.determineCellStyle(r, n | |||
local color | local color | ||
if n == 1 then | if n == 1 then | ||
color = p.determineColor(r) | color = p.determineColor(r) | ||
elseif tonumber(r) <= 30 then | |||
color = "#56e156" | |||
else | else | ||
color = "#afeeee" | |||
color = | |||
end | end | ||
return string.format('style="background-color: %s;"', color) | return string.format('style="background-color: %s;"', color) |
Revision as of 16:31, 5 May 2024
Documentation for this module may be created at Module:DropsLineTest/doc
local p = {}
function p.determineColor(r)
if tonumber(r) <= 1 then
return "#afeeee"
elseif tonumber(r) <= 25 then
return "#56e156"
elseif tonumber(r) <= 100 then
return "#ffed4c"
elseif tonumber(r) <= 1000 then
return "#ff863c"
elseif tonumber(r) <= 9999999 then
return "#ff6262"
else
return "#ffffff"
end
end
function p.determineCellStyle(r, n)
local color
if n == 1 then
color = p.determineColor(r)
elseif tonumber(r) <= 30 then
color = "#56e156"
else
color = "#afeeee"
end
return string.format('style="background-color: %s;"', color)
end
return p