Module:Color contrast: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
Content added Content deleted
(add support for hsl)
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