Module:Color contrast: Difference between revisions
no edit summary
m>Frietjes No edit summary |
m>Frietjes No edit summary |
||
Line 120: | Line 120: | ||
local v1 = color2lum(frame.args[1] or frame:getParent().args[1]) | local v1 = color2lum(frame.args[1] or frame:getParent().args[1]) | ||
local v2 = color2lum(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) | if (type(v1) == 'number' and type(v2) == 'number') then | ||
return (v2 + 0.05)/(v1 + 0.05) | |||
else | |||
return frame.args['error'] or frame:getParent().args['error'] or '?' | |||
end | |||
end | end | ||
return p | return p |