Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What would I do to get the negative Color3/BrickColor of something?

Okay, let me get some things straight:

1. I know this is not a request site

2. I know that I have not posted any code in this question, but that is because I have no idea how I am going to do this

What I am trying to do is:

I am trying to make the TextColor of my TextLabel be the negative/opposite of what the BrickColor of what Object the mouse is pointing at, has.

I know how to get the target of the mouse and it's BrickColor and changing Color3's and stuff, but I do not know how I would get the negative Color3/BrickColor of something.

Any help is greatly appreciated!

2 comments

0

you use a negative sign.........................................................................................

0

I already tried doing that.

1 answer

✓ Accepted answer
local function returnneg(colorval)
	return Color3.new(1-colorval.r, 1-colorval.g, 1-colorval.b) --returns a color3 value thats where numbers are from 0 to 1 but its the opposite
	--to get the specific color use .r, .g, .b, and it will turn it to 1-0 automatically so by taking away from one it will be opposite
end
local base = Color3.fromRGB(100,250,30) --green , goes to purple
local negbase = returnneg(base)
workspace.Baseplate.Color = base
wait(3)
workspace.Baseplate.Color = negbase

basically using 1 to make it negative and a function to return it. (returnneg(base) , base can be Color3.new , Color.fromRGB ect)
EDIT : This is just an example of how you would implement it. e.g:

local function returnneg(colorval)
	return Color3.new(1-colorval.r, 1-colorval.g, 1-colorval.b)
end
local base = mouse.Target.Color
local negbase = returnneg(base) --basically saying local negbase = Color3.new(opposite color)
mouse.Target.Color = negbase

This discussion is preserved as it was. New answers, comments, and votes are closed.