Modul:Color contrast: Unterschied zwischen den Versionen
fix
(fix) |
(fix) |
||
| Zeile 122: | Zeile 122: | ||
end | end | ||
function p._ratio(args) | |||
local v1 = color2lum(c[1]) | local v1 = color2lum(c[1]) | ||
local v2 = color2lum(c[2]) | local v2 = color2lum(c[2]) | ||
| Zeile 128: | Zeile 128: | ||
return (v2 + 0.05)/(v1 + 0.05) | return (v2 + 0.05)/(v1 + 0.05) | ||
else | else | ||
return '' | return args['error'] or '?' | ||
end | end | ||
end | end | ||
| Zeile 138: | Zeile 138: | ||
function p.ratio(frame) | function p.ratio(frame) | ||
local args = frame.args[1] and frame.args or frame:getParent().args | local args = frame.args[1] and frame.args or frame:getParent().args | ||
return p._ratio(args) | |||
end | end | ||
return p | return p | ||