Module:Colors/testcases

From Wikitech
local p = require('Module:UnitTests')

function p:test_hsla2rgba()
	-- Light blue
	self:preprocess_equals('{{#invoke:Colors|hsla2rgba|h=240|s=100|l=75|a=0.25}}', 'rgba(128, 128, 255, 0.25)')
	-- Dark blue
	self:preprocess_equals('{{#invoke:Colors|hsl2hex|h=240|s=100|l=35}}', '\n#0000b3', {nowiki=1})
	-- Light green
	self:preprocess_equals('{{#invoke:Colors|hsla2rgba|h=120|s=100|l=75|a=0.25}}', 'rgba(128, 255, 128, 0.25)')
end

return p