Module:Color contrast: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
v1 should be the brighter of the two
No edit summary
(v1 should be the brighter of the two)
Line 147:
local v2 = color2lum(args[2])
if (type(v1) == 'number' and type(v2) == 'number') then
-- v1 should be the brighter of the two.
return (v2 + 0.05)/(v1 + 0.05)
if v2 > v1 then
v1, v2 = v2, v1
end
return (v2v1 + 0.05)/(v1v2 + 0.05)
else
return args['error'] or '?'
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu