Module:Color contrast: Difference between revisions

no edit summary
m>Frietjes
(better error checking)
m>Frietjes
No edit summary
Line 161: Line 161:
k = k or ''
k = k or ''
v = v or ''
v = v or ''
if (k:match('^[%s]*(background)[%s]*$') or k:match('^[%s]*(background-color)[%s]*$')) then
if (k:match('^[%s]*(background)[%s]*$') or k:match('^[%s]*(background%-color)[%s]*$')) then
local lum = color2lum(v)
local lum = color2lum(v)
if( lum ~= '' ) then bg, lum_bg = v, lum end
if( lum ~= '' ) then bg, lum_bg = v, lum end
Anonymous user