return function()local T=require(script.Parent.GetContrastRatio)local Z={{foreground=Color3.fromHex("\102\102\048\048\048\048"),background=Color3.fromHex("\048\048\048\048\102\102");ratio=-16.58};{foreground=Color3.fromHex("\051\051\051\051\051\051");background=Color3.fromHex("\052\052\052\052\052\052"),ratio=3.95};{foreground=Color3.fromHex("\048\048\048\048\048\048"),background=Color3.fromHex("\102\102\102\102\102\102"),ratio=105.97}}it("\116\104\114\111\119\115 \105\102 \097\114\103\117\109\101\110\116\115 \097\114\101 \110\111\116 \067\111\108\111\114\051\115",function()(expect(pcall(T,Color3.new(),true))).to.equal(false);(expect(pcall(T,true,Color3.new()))).to.equal(false);(expect(pcall(T,100,true))).to.equal(false)end)for Z,r in ipairs(Z)do local i=string.format("\099\097\108\099\117\108\097\116\101\115 \116\104\101 \065\080\067\065 \099\111\110\116\114\097\115\116 \114\097\116\105\111 \098\101\116\119\101\101\110 \035\037\115 \097\110\100 \035\037\115",r.foreground:ToHex(),r.background:ToHex())it(i,function()local Z=T(r.foreground,r.background);(expect(Z)).to.be.near(r.ratio,.01)end)end end
return function()
	local GetContrastRatio = require(script.Parent.GetContrastRatio)

	local TESTS = {
		{
			foreground = Color3.fromHex("ff0000"),
			background = Color3.fromHex("0000ff"),
			ratio = -16.58,
		},
		{
			foreground = Color3.fromHex("333333"),
			background = Color3.fromHex("444444"),
			ratio = 3.95,
		},
		{
			foreground = Color3.fromHex("000000"),
			background = Color3.fromHex("ffffff"),
			ratio = 105.97,
		},
	}

	it("throws if arguments are not Color3s", function()
		expect(pcall(GetContrastRatio, Color3.new(), true)).to.equal(false)
		expect(pcall(GetContrastRatio, true, Color3.new())).to.equal(false)
		expect(pcall(GetContrastRatio, 100, true)).to.equal(false)
	end)

	for _, test in ipairs(TESTS) do
		local TEST_NAME = string.format(
			"calculates the APCA contrast ratio between #%s and #%s",
			test.foreground:ToHex(),
			test.background:ToHex()
		)

		it(TEST_NAME, function()
			local ratio = GetContrastRatio(test.foreground, test.background)
			expect(ratio).to.be.near(test.ratio, 0.01)
		end)
	end
end
