local T=require(script.Parent.Util.BasicallyIdentical)return function()local Z=require(script.Parent.Desaturate)local r=Color3.fromHex("\035\048\048\097\050\102\102")local i=Color3.fromHex("\035\056\048\100\048\102\102")local e=.5 it("\115\104\111\117\108\100 \100\101\115\097\116\117\114\097\116\101 \097 \099\111\108\111\114",function()local H=Z(r,e);(expect(T(i,H))).to.equal(true)end)it("\116\104\114\111\119\115 \105\102 \097\114\103\117\109\101\110\116 \105\115 \110\111\116 \097 \067\111\108\111\114\051",function()(expect(function()Z(nil,e)end)).to.throw();(expect(function()Z(true,e)end)).to.throw()end)it("\116\104\114\111\119\115 \105\102 \097\109\111\117\110\116 \105\115 \110\111\116 \097 \110\117\109\098\101\114",function()(expect(function()Z(r,nil)end)).to.throw();(expect(function()Z(r,true)end)).to.throw()end)end
local BasicallyIdentical = require(script.Parent.Util.BasicallyIdentical)

return function()
	local Desaturate = require(script.Parent.Desaturate)

	local TEST_BASE = Color3.fromHex("#00a2ff")
	local TEST_RESULT = Color3.fromHex("#80d0ff")
	local TEST_AMOUNT = 0.5

	it("should desaturate a color", function()
		local color = Desaturate(TEST_BASE, TEST_AMOUNT)

		expect(BasicallyIdentical(TEST_RESULT, color)).to.equal(true)
	end)

	it("throws if argument is not a Color3", function()
		expect(function()
			Desaturate(nil, TEST_AMOUNT)
		end).to.throw()

		expect(function()
			Desaturate(true, TEST_AMOUNT)
		end).to.throw()
	end)

	it("throws if amount is not a number", function()
		expect(function()
			Desaturate(TEST_BASE, nil)
		end).to.throw()

		expect(function()
			Desaturate(TEST_BASE, true)
		end).to.throw()
	end)
end
