Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Color contrast: Difference between revisions

Content added Content deleted
(typo)
Line 137: Line 137:
end
end
if (type(v1) == 'number' and type(v3) == 'number') then
if (type(v1) == 'number' and type(v3) == 'number') then
ratio1 = (v3 + 0.05)/(v1 + 0.05)
ratio2 = (v3 + 0.05)/(v1 + 0.05)
ratio1 = (ratio1 < 1) and 1/ratio1 or ratio1
ratio2 = (ratio2 < 1) and 1/ratio2 or ratio2
end
end
return (ratio1 + bias > ratio2) and c2 or c3
return (ratio1 + bias > ratio2) and c2 or c3
Cookies help us deliver our services. By using our services, you agree to our use of cookies.