Module:Color contrast: Difference between revisions

no edit summary
m>Frietjes
(add support for hsl)
m>Frietjes
No edit summary
Line 56: Line 56:
end
end
-- whitespace
-- whitespace
c = c:match( '^%s*(.-)%s*$' )
c = c:match( '^%s*(.-)[%s;]*$' )


-- lowercase
-- lowercase
Line 67: Line 67:
end
end
-- remove leading # (if there is one) and whitespace
-- remove leading # (if there is one) and whitespace
c = mw.ustring.match(c, '^[%s#]*([a-f0-9]*)[%s;]*$')
c = mw.ustring.match(c, '^[%s#]*([a-f0-9]*)[%s]*$')


   -- convert from hsl
   -- convert from hsl
Anonymous user