How to get inverted color

As the title says. Lets say you have the color white and it becomes black when you invert it.

If I remember correctly it’d look like this:

local color3 = YOUR_COLOR_HERE
local r = 255 - (color3.R * 255)
local g -- repeat process
local b --repeat process

local newColor = Color3.fromRGB(r,g,b)