Is there an equation/function that is available to use to calculate the opposite of a given colour (sometimes known as complementary) without having to write a massive table??
For example, the opposite of white (255/255,255/255,255/255) is black (0/255,0/255,0/255)
[EDIT]
I've tried getting the opposite using this formula, but isn't 100% efficient:
Original Color = r,g,b Opposite/Complimentary = 255-r,255-g,255-b
The opposite color is the result of 255 take away the value of its respective color.
Tested code on a TextLabel:
while true do
Redrandom = math.random(0,255)
Greenrandom = math.random(0,255)
Bluerandom = math.random(0,255)
script.Parent.BackgroundColor3 = Color3.new(Redrandom/255,Greenrandom/255,Bluerandom/255) -- Original Color
script.Parent.TextColor3 = Color3.new((255-Redrandom)/255,(255-Greenrandom)/255,(255-Bluerandom)/255) --Opposite Color
script.Parent.TextStrokeColor3 = Color3.new((255-Redrandom)/255,(255-Greenrandom)/255,(255-Bluerandom)/255) --Opposite Color
wait(math.random(1,10)/10)
end
I understand there's a different function to create a color using RGB colors up to 255, but I prefer this method.

2 comments
Doing my research, your method seems like it should work. What exactly is wrong with this, I understand that it's not 100% efficient, but what doesn't work?
Nothing's wrong, but I'm trying to get it as efficient as possible