local connections = {}
local color = Color3.new(1, 1, 1)
local colordis
colordis = colordis or game.Players.LocalPlayer.PlayerGui:FindFirstChild("PaintFrame", true):FindFirstChild("ColourDisplay", true)
local cwheel = colordis.Parent.Parent.hsvframe.ColourWheel
local dp = cwheel.Parent.DarknessPicker
local function updateHS()
local mouse = game.Players.LocalPlayer:GetMouse()
local diffX = mouse.X - (cwheel.AbsolutePosition.X + cwheel.AbsoluteSize.X / 2)
local diffY = mouse.Y - (cwheel.AbsolutePosition.Y + cwheel.AbsoluteSize.Y / 2)
local h = (math.pi - math.atan2(diffY, diffX)) / (math.pi * 2)
local s = (Vector2.new(cwheel.AbsolutePosition.X + cwheel.AbsoluteSize.X / 2, cwheel.AbsolutePosition.Y + cwheel.AbsoluteSize.Y / 2) - Vector2.new(mouse.X, mouse.Y)).Magnitude / (cwheel.AbsoluteSize.X / 2)
return h, s
end
local function updateV()
local mouse = game.Players.LocalPlayer:GetMouse()
local value = 1 - ((mouse.Y - dp.AbsolutePosition.Y) / dp.AbsoluteSize.Y)
local clamped_value = math.clamp(value, 0, 1)
return clamped_value
end
local function inverseHSV()
local hue, sat, val = color:ToHSV()
dp.Slider.Position = UDim2.fromScale(0.5, 1 - val)
local picker = cwheel.Picker
local angle = 360 * (hue / 1)
local radius = (cwheel.AbsoluteSize.X / 2) * sat
local vector = Vector2.new(radius * math.cos(math.rad(angle)), radius * math.sin(math.rad(angle)))
picker.Position = UDim2.new(0.5, 0, 0.5, 0) + UDim2.fromOffset(-vector.X, vector.Y)
color = Color3.fromHSV(hue, sat, val)
dp.UIGradient.Color = ColorSequence.new(Color3.fromHSV(hue, sat, 1), Color3.new(0, 0, 0))
end
local h, s, v = updateHS()
v = 1
colordis.BackgroundColor3 = Color3.fromHSV(h, s, v)
local plr = game.Players.LocalPlayer
local uis = game:GetService("UserInputService")
local md = false
table.insert(connections, uis.InputEnded:Connect(function(k, g)
if k.UserInputType == Enum.UserInputType.MouseButton1 then
md = true
end
end))
table.insert(connections, cwheel.MouseButton1Down:Connect(function()
local absx, absy = cwheel.AbsolutePosition.X + cwheel.AbsoluteSize.X/2, cwheel.AbsolutePosition.Y + cwheel.AbsoluteSize.Y/2
md = false
while not md do
if ((plr:GetMouse().X - absx)^2 + (plr:GetMouse().Y - absy)^2)^(0.5) < (cwheel.AbsoluteSize.X / 2) then
cwheel.Picker.Position = UDim2.fromScale((plr:GetMouse().X - absx) / cwheel.AbsoluteSize.X, (plr:GetMouse().Y - absy) / cwheel.AbsoluteSize.Y) + UDim2.fromOffset(cwheel.AbsoluteSize.X/2, cwheel.AbsoluteSize.Y/2)
h, s = updateHS()
color = Color3.fromHSV(h, s, v)
dp.UIGradient.Color = ColorSequence.new(Color3.fromHSV(h, s, 1), Color3.new(0, 0, 0))
colordis.BackgroundColor3 = color
end
task.wait()
end
md = false
end))
table.insert(connections, dp.MouseButton1Down:Connect(function()
local absx, absy = dp.AbsolutePosition.X, dp.AbsolutePosition.Y
md = false
while not md do
local yval = (math.clamp(plr:GetMouse().Y, absy, absy + dp.AbsoluteSize.Y) - absy) / dp.AbsoluteSize.Y
dp.Slider.Position = UDim2.new(0.5, 0, yval, 0)
v = 1 - yval
color = Color3.fromHSV(h, s, v)
colordis.BackgroundColor3 = color
task.wait()
end
md = false
end))
local Mouse = game:GetService("Players").LocalPlayer:GetMouse()
Mouse.TargetFilter = Garage
local Material = "Plastic"
local function PaintPart()
local Part = Mouse.Target
if Part then
Part.Color = color
Part.Material = Enum.Material[Material]
else
end
end
local PaintFrame = colordis.Parent.Parent.Parent.PaintFrame
local mat = PaintFrame.mat.MaterialDIsplay.TextLabel
local function SelectMaterial(Material)
Material = Material
mat.Text = Material
end
SelectMaterial("Plastic")
table.insert(connections, Mouse.Button1Down:Connect(function()
md = false
PaintPart()
task.wait(1)
while md == false do
PaintPart()
task.wait()
end
end))
table.insert(connections, Mouse.Button1Up:Connect(function()
md = true
end))
table.insert(connections, Mouse.Button2Down:Connect(function()
local part = Mouse.Target
if part then
color = part.Color
inverseHSV()
else
end
end))
for i, v in PaintFrame.ScrollingFrame:GetChildren() do
local Button = v:FindFirstChild("TextButton")
if Button then
table.insert(connections, Button.MouseButton1Down:Connect(function()
SelectMaterial(tostring(v))
end))
end
end
return connections
end```
cwheel means color wheel
dp means darkness pickers