Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
nanaluk01 247 Moderation Voter
7 years ago
Edited 7 years ago

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 TextColorof my TextLabelbe the negative/opposite of what the BrickColorof what Objectthe mouse is pointing at, has.

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

Any help is greatly appreciated!

0
you use a negative sign......................................................................................... hiimgoodpack 2009 — 7y
0
I already tried doing that. nanaluk01 247 — 7y

1 answer

Log in to vote
3
Answered by 7 years ago
Edited 7 years ago
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
Ad

Answer this question