Module:Color contrast: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
fix for garbage input
m (local)
(fix for garbage input)
Line 126:
local c3 = args[3] or '#000000'
local v3 = color2lum(c3)
local ratio1 = 0-1;
local ratio2 = 0-1;
if (type(v1) == 'number' and type(v2) == 'number') then
ratio1 = (v2 + 0.05)/(v1 + 0.05)
Line 136:
ratio2 = (ratio2 < 1) and 1/ratio2 or ratio2
end
return (ratio1 > 0) and (ratio2 > 0) and ((ratio1 + bias > ratio2) and c2 or c3) or ''
end
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu