Inverting Part Colors

Hi there! Hope you are having a great day. I’m current in the midst of making a game and recently finished the pet system. I want to make something similar to Bubble Gum Simulator’s shiny pets. The shiny pets in their game have colors inverted to make them differentiate. I was thinking to myself how I would do it. I have no idea how to do anything like that. Did they manually do the inverting by themselves or is it some automatic thing?

I’m not looking for any scripts. Just a way I can do something like that

Thanks

2 Likes

To invert a Color3, do something like this:

local color = workspace.Part.Color
local invertedColor = Color3.new(1 - color.R, 1 - color.G, 1 - color.B)
7 Likes

If I remember correctly, we ‘flipped’ the hue, something like:

local h, s, v = Color3.toHSV(color)
local inverted = Color3.fromHSV((h + 0.5) % 1, s, v)

Bear in mind that this approach won’t handle particularly light/dark colors well, nor will it do anything meaningful with very desaturated colors (white, grays, black).

12 Likes