Modul:Color contrast: Unterschied zwischen den Versionen
v1 should be the brighter of the two
Keine Bearbeitungszusammenfassung |
(v1 should be the brighter of the two) |
||
| Zeile 147: | Zeile 147: | ||
local v2 = color2lum(args[2]) | local v2 = color2lum(args[2]) | ||
if (type(v1) == 'number' and type(v2) == 'number') then | if (type(v1) == 'number' and type(v2) == 'number') then | ||
return ( | -- v1 should be the brighter of the two. | ||
if v2 > v1 then | |||
v1, v2 = v2, v1 | |||
end | |||
return (v1 + 0.05)/(v2 + 0.05) | |||
else | else | ||
return args['error'] or '?' | return args['error'] or '?' | ||