Editing Module:Color contrast
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 81: | Line 81: | ||
return L | return L | ||
end | end | ||
-- remove leading # (if there is one) and whitespace | |||
c = mw.ustring.match(c, '^[%s#]*([a-f0-9]*)[%s]*$') | |||
-- convert from hsl | -- convert from hsl | ||
Line 99: | Line 101: | ||
return rgbdec2lum(255*tonumber(R)/100, 255*tonumber(G)/100, 255*tonumber(B)/100) | return rgbdec2lum(255*tonumber(R)/100, 255*tonumber(G)/100, 255*tonumber(B)/100) | ||
end | end | ||
-- split into rgb | -- split into rgb |