local H=require((game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")):WaitForChild("\078\101\118\101\114\109\111\114\101"))local A=H("\083\112\114\105\110\103")local Q={}Q.ClassName="\067\111\108\111\114\051\080\114\111\112\101\114\116\121\084\119\101\101\110\101\114"Q.__index=Q function Q.new(H,u)local T=setmetatable({},Q)T._object=H or error("\078\111 \111\106\101\099\116")T._property=u or error("\078\111 \112\114\111\112\101\114\116\121")local V=T._object[T._property]if typeof(V)~="\067\111\108\111\114\051"then error(("\066\097\100 \112\114\111\112\101\114\116\121 \037\113\044 \101\120\112\101\099\116\101\100 \067\111\108\111\114\051\044 \103\111\116 \037\113"):format(T._property,typeof(V)))end local K,x,h=Color3.toHSV(V)T._currentState=A.new(Vector3.new(K,x,h))T._currentState.Speed=20 return T end function Q.SetSpeed(A,H)A._currentState.Speed=H or error("\078\111 \115\112\101\101\100")end function Q.Tween(A,H)assert(typeof(H)=="\067\111\108\111\114\051","\084\097\114\103\101\116 \109\117\115\116 \098\101 \097 \067\111\108\111\114\051")local Q,u,T=Color3.toHSV(H)A._currentState.Target=Vector3.new(Q,u,T)end function Q.Update(H)local A=H._currentState.Value local Q,u,T=A.x,A.y,A.z local V=(A-H._currentState.Target).Magnitude>=.001 if not V then local A=H._currentState.Target Q,u,T=A.x,A.y,A.z end H._object[H._property]=Color3.fromHSV(Q,u,T)return V end return Q
--- Tweens color3s by HSV
-- @classmod Color3PropertyTweener

local require = require(game:GetService("ReplicatedStorage"):WaitForChild("Nevermore"))

local Spring = require("Spring")

local Color3PropertyTweener = {}
Color3PropertyTweener.ClassName = "Color3PropertyTweener"
Color3PropertyTweener.__index = Color3PropertyTweener

function Color3PropertyTweener.new(object, property)
	local self = setmetatable({}, Color3PropertyTweener)

	self._object = object or error("No oject")
	self._property = property or error("No property")

	local color = self._object[self._property]
	if typeof(color) ~= "Color3" then
		error(("Bad property %q, expected Color3, got %q"):format(self._property, typeof(color)))
	end
	local h, s, v = Color3.toHSV(color)
	self._currentState = Spring.new(Vector3.new(h, s, v))
	self._currentState.Speed = 20

	return self
end

function Color3PropertyTweener:SetSpeed(speed)
	self._currentState.Speed = speed or error("No speed")
end

function Color3PropertyTweener:Tween(target)
	assert(typeof(target) == "Color3", "Target must be a Color3")

	local h, s, v = Color3.toHSV(target)
	self._currentState.Target = Vector3.new(h, s, v)
end

function Color3PropertyTweener:Update()
	local current = self._currentState.Value
	local h, s, v = current.x, current.y, current.z

	local stillUpdating = (current - self._currentState.Target).Magnitude >= 1e-3
	if not stillUpdating then
		local target = self._currentState.Target
		h, s, v = target.x, target.y, target.z
	end
	self._object[self._property] = Color3.fromHSV(h, s, v)

	return stillUpdating
end

return Color3PropertyTweener
