lets say I wanted it to be bright red with its RGB value of 196, 40, 28 but inverted so it looks like Cyan-ish so how to determine it?
Take each of the RGB values, and then invert them, you can do this like this:
local Color = script.Parent.Color
--Inverse Color's Components
local r, g, b = 0,0,0
r = 255 - Color.R
g = 255 - Color.G
b = 255 - Color.B
script.Parent.Color = Color3.fromRGB(r,g,b)
This should work, I believe. I tested it with your given colors, and it gave me a color like this:
2 Likes
I’m not sure how exactly what you meant, but usually, I use this image as a reference:
or just basically use software that can invert colors like on Paint .NET for example.
1 Like
My red turned white not supposed cyan
Could you give me the Color3 Value?
Oh, my bad sorry, I forgot that the Color3 values aren’t in RGB by default, so you need to multiply each of them with 255 before you subtract
local Color = script.Parent.Color
--Inverse Color's Components
local r, g, b = 0,0,0
r = 255 - (Color.R*255)
g = 255 - (Color.G*255)
b = 255 - (Color.B*255)
script.Parent.Color = Color3.fromRGB(r,g,b)
4 Likes
Thanks! it worked, have a great day
1 Like
You can also get a color’s complimentary color like this:
local function complimentaryColor(color3)
local h, s, v = color3:ToHSV()
h = (h + 0.5) % 1 --add half of the hue wheel, then wrap around 1
return Color3.fromHSV(h, s, v)
end
3 Likes