local b=dragger.new(slide,slider)local H=dragger.new(ring,wheel)function b.onDrag(Y,b,H,J)local w=H.Position.y-slider.AbsolutePosition.y local O=math.clamp(w,0,slider.AbsoluteSize.y-slide.AbsoluteSize.y)b.Position=UDim2.new(0,0,0,O)value=1-O/(slider.AbsoluteSize.y-slide.AbsoluteSize.y)b.BackgroundColor3=Color3.fromHSV(0,0,1-value)update()end function H.onDrag(Y,b,H,J)local w=wheel.AbsoluteSize.x/2 local O=(Vector2.new(H.Position.x,H.Position.y)-wheel.AbsolutePosition)-wheel.AbsoluteSize/2 if O:Dot(O)>w*w then O=O.unit*w end b.Position=UDim2.new(.5,O.x,.5,O.y)local P,T=toPolar(O*Vector2.new(1,-1))hue,saturation=radToDeg(P)/360,T/w slider.BackgroundColor3=Color3.fromHSV(hue,saturation,1)update()end
-- dragger

local slideDrag = dragger.new(slide, slider)
local ringDrag = dragger.new(ring, wheel)

function slideDrag:onDrag(guiElement, input, delta)
	local rY = input.Position.y - slider.AbsolutePosition.y
	local cY = math.clamp(rY, 0, slider.AbsoluteSize.y - slide.AbsoluteSize.y)
	guiElement.Position = UDim2.new(0, 0, 0, cY)

	value = 1 - (cY / (slider.AbsoluteSize.y - slide.AbsoluteSize.y))
	guiElement.BackgroundColor3 = Color3.fromHSV(0, 0, 1 - value)

	update()
end

function ringDrag:onDrag(guiElement, input, delta)
	local r = wheel.AbsoluteSize.x / 2
	local d = Vector2.new(input.Position.x, input.Position.y) - wheel.AbsolutePosition - wheel.AbsoluteSize / 2

	if d:Dot(d) > r * r then
		d = d.unit * r
	end

	guiElement.Position = UDim2.new(0.5, d.x, 0.5, d.y)

	local phi, len = toPolar(d * Vector2.new(1, -1))
	hue, saturation = radToDeg(phi) / 360, len / r
	slider.BackgroundColor3 = Color3.fromHSV(hue, saturation, 1)

	update()
end
