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 83: | Line 83: | ||
-- convert from hsl | -- convert from hsl | ||
if mw.ustring.match(c,'^hsl%([%s]*[0-9][0-9 | if mw.ustring.match(c,'^hsl%([%s]*[0-9][0-9]*[%s]*,[%s]*[0-9][0-9]*%%[%s]*,[%s]*[0-9][0-9]*%%[%s]*%)$') then | ||
local h, s, l = mw.ustring.match(c,'^hsl%([%s]*([0-9][0-9 | local h, s, l = mw.ustring.match(c,'^hsl%([%s]*([0-9][0-9]*)[%s]*,[%s]*([0-9][0-9]*)%%[%s]*,[%s]*([0-9][0-9]*)%%[%s]*%)$') | ||
return hsl2lum(tonumber(h), tonumber(s)/100, tonumber(l)/100) | return hsl2lum(tonumber(h), tonumber(s)/100, tonumber(l)/100) | ||
end | end |