local w=require(script.Parent.Parent.Util.BasicallyIdentical)return function()local u=require(script.Parent.Vibrant)local T={{Color3.fromRGB(226,76,74),Color3.fromRGB(100,106,80),Color3.fromRGB(6,54,42);Color3.fromRGB(85,123,105);Color3.fromRGB(251,242,234),Color3.fromRGB(175,158,130)},{Color3.fromRGB(186,153,69);Color3.fromRGB(222,86,184);Color3.fromRGB(132,124,140),Color3.fromRGB(60,30,24),Color3.fromRGB(8,6,4)},{Color3.fromRGB(207,157,19);Color3.fromRGB(44,65,167),Color3.fromRGB(125,139,156),Color3.fromRGB(102,99,92),Color3.fromRGB(226,226,226)};{Color3.fromRGB(199,176,96),Color3.fromRGB(97,116,205);Color3.fromRGB(108,87,88),Color3.fromRGB(66,60,141);Color3.fromRGB(18,21,30),Color3.fromRGB(201,196,202);Color3.new(1,1,1);Color3.new()};{Color3.new(1,1,1);Color3.new()}}it("\116\104\114\111\119\115 \105\102 \097\114\103\117\109\101\110\116 \105\115 \110\111\116 \097\110 \097\114\114\097\121 \111\102 \067\111\108\111\114\051\115",function()(expect(pcall(u,true))).to.equal(false);(expect(pcall(u,T[1][1]))).to.equal(false)end)it("\114\101\116\117\114\110\115 \097 \067\111\108\111\114\051",function()local w=u(T[1]);(expect(typeof(w))).to.equal("\067\111\108\111\114\051")end)it("\099\111\114\114\101\099\116\108\121 \100\101\116\101\114\109\105\110\101\115 \109\111\115\116 \118\105\098\114\097\110\116 \099\111\108\111\114",function()local S,Z={},{}for w,T in ipairs(T)do local g=u(T)table.insert(S,g)table.insert(Z,T[1])end;(expect(w(Z[1],S[1]))).to.equal(true);(expect(w(Z[2],S[2]))).to.equal(true);(expect(w(Z[3],S[3]))).to.equal(true);(expect(w(Z[4],S[4]))).to.equal(true)end)end
local BasicallyIdentical = require(script.Parent.Parent.Util.BasicallyIdentical)

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

	local testSwatches = {
		{
			Color3.fromRGB(226, 76, 74),
			Color3.fromRGB(100, 106, 80),
			Color3.fromRGB(6, 54, 42),
			Color3.fromRGB(85, 123, 105),
			Color3.fromRGB(251, 242, 234),
			Color3.fromRGB(175, 158, 130),
		},
		{
			Color3.fromRGB(186, 153, 69),
			Color3.fromRGB(222, 86, 184),
			Color3.fromRGB(132, 124, 140),
			Color3.fromRGB(60, 30, 24),
			Color3.fromRGB(8, 6, 4),
		},
		{
			Color3.fromRGB(207, 157, 19),
			Color3.fromRGB(44, 65, 167),
			Color3.fromRGB(125, 139, 156),
			Color3.fromRGB(102, 99, 92),
			Color3.fromRGB(226, 226, 226),
		},
		{
			Color3.fromRGB(199, 176, 96),
			Color3.fromRGB(97, 116, 205),
			Color3.fromRGB(108, 87, 88),
			Color3.fromRGB(66, 60, 141),
			Color3.fromRGB(18, 21, 30),
			Color3.fromRGB(201, 196, 202),
			Color3.new(1, 1, 1),
			Color3.new(),
		},
		{
			Color3.new(1, 1, 1),
			Color3.new(),
		},
	}

	it("throws if argument is not an array of Color3s", function()
		expect(pcall(Vibrant, true)).to.equal(false)
		expect(pcall(Vibrant, testSwatches[1][1])).to.equal(false)
	end)

	it("returns a Color3", function()
		local result = Vibrant(testSwatches[1])
		expect(typeof(result)).to.equal("Color3")
	end)

	it("correctly determines most vibrant color", function()
		local results, expects = {}, {}

		for _, swatches in ipairs(testSwatches) do
			local result = Vibrant(swatches)

			table.insert(results, result)
			table.insert(expects, swatches[1])
		end

		expect(BasicallyIdentical(expects[1], results[1])).to.equal(true)
		expect(BasicallyIdentical(expects[2], results[2])).to.equal(true)
		expect(BasicallyIdentical(expects[3], results[3])).to.equal(true)
		expect(BasicallyIdentical(expects[4], results[4])).to.equal(true)
	end)
end
