Jump to content

Module:Color contrast: Difference between revisions

no edit summary
m>Frietjes
(Created page with '-- -- This module implements -- {{Color contrast ration}} -- {{ColorToLum}} -- {{RGBColorToLum}} -- local p = {} local function sRGB ( v ) if (v <= 0.0392...')
 
m>Frietjes
No edit summary
Line 118: Line 118:


function p.ratio(frame)
function p.ratio(frame)
local v1 = color2num(frame.args[1] or frame:getParent().args[1])
local v1 = color2lum(frame.args[1] or frame:getParent().args[1])
local v2 = color2num(frame.args[2] or frame:getParent().args[2])
local v2 = color2lum(frame.args[2] or frame:getParent().args[2])
return (v2 + 0.05)/(v1 + 0.05)
return (v2 + 0.05)/(v1 + 0.05)
end
end
   
   
return p
return p
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.