local G=dragger.new(slide,slider)local v=dragger.new(ring,wheel)function G.onDrag(d,G,v,S)local u=v.Position.y-slider.AbsolutePosition.y local t=math.clamp(u,0,slider.AbsoluteSize.y-slide.AbsoluteSize.y)G.Position=UDim2.new(0,0,0,t)value=1-t/(slider.AbsoluteSize.y-slide.AbsoluteSize.y)G.BackgroundColor3=Color3.fromHSV(0,0,1-value)update()end function v.onDrag(d,G,v,S)local u=wheel.AbsoluteSize.x/2 local t=(Vector2.new(v.Position.x,v.Position.y)-wheel.AbsolutePosition)-wheel.AbsoluteSize/2 if t:Dot(t)>u*u then t=t.unit*u end G.Position=UDim2.new(.5,t.x,.5,t.y)local l,g=toPolar(t*Vector2.new(1,-1))hue,saturation=radToDeg(l)/360,g/u slider.BackgroundColor3=Color3.fromHSV(hue,saturation,1)update()end


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
