Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function waitForChild(instance, name) if instance:FindFirstChild(name) then return instance:FindFirstChild(name) end
- repeat wait() until instance:FindFirstChild(name) return instance:FindFirstChild(name) end
- function waitForProperty(instance, name) if instance[name] then return instance[name] end repeat wait() until instance[name] return instance[name] end
- local mouse = waitForProperty(game:service("Players"), "LocalPlayer"):GetMouse()
- local index = waitForProperty(game, "Workspace")
- local spectre = waitForChild(script.Parent, "Spectre")
- local cursor = waitForChild(spectre, "Cursor")
- local preview = waitForChild(index, "Part")
- local sat = waitForChild(script.Parent, "Satuation")
- local cursor2 = waitForChild(sat, "Cursor")
- local isDown = {} -- For dragging purpose.
- local data = {{0, 1, 0}, {0, 1, 1}} -- Storing colors.
- game:service("ContentProvider"):Preload(cursor.Image)
- local output = waitForChild(script.Parent, "Output")
- function HSVtoRGB(rawh, rawm, rawv, setColor)
- local h = ((rawh - spectre.AbsolutePosition.X) / spectre.AbsoluteSize.X)
- local v = ((rawv - spectre.AbsolutePosition.Y) / spectre.AbsoluteSize.Y)
- local s = 1
- local m = (rawm and 1 - ((rawm - sat.AbsolutePosition.Y) / sat.AbsoluteSize.Y)) or 1
- v = (1 - v) * 2
- if h > 1 then h = 1 elseif h < 0 then h = 0 end if v > 2 then v = 2 elseif v < 0 then v = 0 end if m > 1 then m = 1 elseif m < 0 then m = 0 end
- local r, g, b
- local i = math.floor(h * 6)
- local f = h * 6 - i
- local p = v * (1 - s)
- local q = v * (1 - f * s)
- local t = v * (1 - (1 - f) * s)
- local switch = i % 6
- if switch == 0 then
- r = v g = t b = p
- elseif switch == 1 then
- r = q g = v b = p
- elseif switch == 2 then
- r = p g = v b = t
- elseif switch == 3 then
- r = p g = q b = v
- elseif switch == 4 then
- r = t g = p b = v
- elseif switch == 5 then
- r = v g = p b = q
- end
- r, g, b = math.floor(r * 255), math.floor(g * 255), math.floor(b * 255)
- if v > 1 then
- r = r + (255 - r) * (v - 1)
- g = g + (255 - g) * (v - 1)
- b = b + (255 - b) * (v - 1)
- end
- if r > 255 then r = 255 end if g > 255 then g = 255 end if b > 255 then b = 255 end
- sat.BackgroundColor3 = Color3.new(r / 255, g / 255, b / 255)
- r, g, b = math.floor(128 - (128 - r) * m), math.floor(128 - (128 - g) * m), math.floor(128 - (128 - b) * m)
- if r > 255 then r = 255 end if g > 255 then g = 255 end if b > 255 then b = 255 end
- cursor.Position = UDim2.new(h, -5, -(v / 2) + 1, -5)
- cursor2.Position = UDim2.new(0, 0, 1 - m, 0)
- output.Text = tostring(table.concat({r,g,b}, ", "))
- game.Players.LocalPlayer.Stats.Character.SkinColor.Value = Color3.new(r/ 255,g/ 255,b/ 255)
- if setColor then
- game.Players.LocalPlayer.Character:FindFirstChild("Head").BrickColor = BrickColor.new(Color3.new(r/ 255,g/ 255,b/ 255))
- game.Players.LocalPlayer.Character:FindFirstChild("UpperTorso").BrickColor = BrickColor.new(Color3.new(r/ 255,g/ 255,b/ 255))
- game.Players.LocalPlayer.Character:FindFirstChild("RightUpperLeg").BrickColor = BrickColor.new(Color3.new(r/ 255,g/ 255,b/ 255))
- game.Players.LocalPlayer.Character:FindFirstChild("RightUpperArm").BrickColor = BrickColor.new(Color3.new(r/ 255,g/ 255,b/ 255))
- game.Players.LocalPlayer.Character:FindFirstChild("RightLowerLeg").BrickColor = BrickColor.new(Color3.new(r/ 255,g/ 255,b/ 255))
- game.Players.LocalPlayer.Character:FindFirstChild("RightLowerArm").BrickColor = BrickColor.new(Color3.new(r/ 255,g/ 255,b/ 255))
- game.Players.LocalPlayer.Character:FindFirstChild("RightHand").BrickColor = BrickColor.new(Color3.new(r/ 255,g/ 255,b/ 255))
- game.Players.LocalPlayer.Character:FindFirstChild("RightFoot").BrickColor = BrickColor.new(Color3.new(r/ 255,g/ 255,b/ 255))
- game.Players.LocalPlayer.Character:FindFirstChild("LowerTorso").BrickColor = BrickColor.new(Color3.new(r/ 255,g/ 255,b/ 255))
- game.Players.LocalPlayer.Character:FindFirstChild("LeftUpperLeg").BrickColor = BrickColor.new(Color3.new(r/ 255,g/ 255,b/ 255))
- game.Players.LocalPlayer.Character:FindFirstChild("LeftUpperArm").BrickColor = BrickColor.new(Color3.new(r/ 255,g/ 255,b/ 255))
- game.Players.LocalPlayer.Character:FindFirstChild("LeftLowerLeg").BrickColor = BrickColor.new(Color3.new(r/ 255,g/ 255,b/ 255))
- game.Players.LocalPlayer.Character:FindFirstChild("LeftLowerArm").BrickColor = BrickColor.new(Color3.new(r/ 255,g/ 255,b/ 255))
- game.Players.LocalPlayer.Character:FindFirstChild("LeftHand").BrickColor = BrickColor.new(Color3.new(r/ 255,g/ 255,b/ 255))
- game.Players.LocalPlayer.Character:FindFirstChild("LeftFoot").BrickColor = BrickColor.new(Color3.new(r/ 255,g/ 255,b/ 255))
- preview.BrickColor = BrickColor.new(Color3.new(r / 255, g / 255, b / 255))
- data[tonumber(setColor)][1] = rawh
- data[tonumber(setColor)][2] = m
- data[tonumber(setColor)][3] = rawv
- end
- return Color3.new(r / 255, g / 255, b / 255)
- end
- spectre.MouseButton1Down:connect(function(x, y) isDown["h1"] = true HSVtoRGB(x, nil, y, "1") end)
- spectre.MouseButton2Down:connect(function(x, y) isDown["h2"] = true HSVtoRGB(x, nil, y, "2") end)
- mouse.Move:connect(function() if isDown["h1"] then HSVtoRGB(mouse.X,nil,mouse.Y,"1") elseif isDown["h2"] then HSVtoRGB(mouse.X,nil,mouse.Y,"2")
- elseif isDown["s1"] then HSVtoRGB(data[1][1], mouse.Y, data[1][3], "1") elseif isDown["s2"] then HSVtoRGB(data[2][1], mouse.Y, data[2][3], "2") end end)
- spectre.MouseButton1Up:connect(function() isDown["h1"] = nil end) mouse.Button1Up:connect(function() isDown["h1"], isDown["s1"] = nil, nil end)
- spectre.MouseButton2Up:connect(function() isDown["h2"] = nil end) mouse.Button2Up:connect(function() isDown["h2"], isDown["s2"] = nil, nil end)
- sat.MouseButton1Up:connect(function() isDown["s1"] = nil end) sat.MouseButton1Down:connect(function(x, y) isDown["s1"] = true
- HSVtoRGB(data[1][1], y, data[1][3], "1") end)
- sat.MouseButton2Up:connect(function() isDown["s2"] = nil end) sat.MouseButton2Down:connect(function(x, y) isDown["s2"] = true
- HSVtoRGB(data[2][1], y, data[2][3], "2") end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement