Module:Color contrast: Difference between revisions
Content added Content deleted
(implement Template:Greater contrast ratio) |
(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 |
||
ratio2 = (v3 + 0.05)/(v1 + 0.05) |
|||
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 |