Module:DropsLineTest: Difference between revisions

From Roat Pkz
Jump to navigation Jump to search
(Created page with "local p = {} function p.determineColor(r) if r <= 1 then return "#afeeee" elseif r <= 25 then return "#56e156" elseif r <= 100 then return "#ffed4c" elseif r <= 1000 then return "#ff863c" elseif r <= 9999999 then return "#ff6262" else return "#ffffff" end end return p")
 
No edit summary
Line 15: Line 15:
         return "#ffffff"
         return "#ffffff"
     end
     end
end
function p.determineCellStyle(r, n)
    local color
    if n == 1 then
        color = p.determineColor(r)
    elseif r <= 30 then
        color = "#56e156"
    else
        color = "#afeeee"
    end
    return string.format('style="background-color: %s;"', color)
end
end


return p
return p

Revision as of 15:58, 5 May 2024

Documentation for this module may be created at Module:DropsLineTest/doc

local p = {}

function p.determineColor(r)
    if r <= 1 then
        return "#afeeee"
    elseif r <= 25 then
        return "#56e156"
    elseif r <= 100 then
        return "#ffed4c"
    elseif r <= 1000 then
        return "#ff863c"
    elseif 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 r <= 30 then
        color = "#56e156"
    else
        color = "#afeeee"
    end
    return string.format('style="background-color: %s;"', color)
end

return p