Module:Color contrast: Difference between revisions

no edit summary
m>Frietjes
No edit summary
m>Frietjes
No edit summary
Line 66: Line 66:
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 76: Line 74:
return hsl2rgb(tonumber(h), tonumber(s)/100, tonumber(l)/100)
return hsl2rgb(tonumber(h), tonumber(s)/100, tonumber(l)/100)
   end
   end
-- remove leading # (if there is one) and whitespace
c = mw.ustring.match(c, '^[%s#]*([a-f0-9]*)[%s]*$')


-- split into rgb
-- split into rgb
Anonymous user