Currently, if the CURRENT_BULLET increases, the amount of the color teal will increase. Now I want a formula that will increase the amount of red while the CURRENT_BULLET decreases. I have tried moving the formula around a bit but I still could not find what path I could do to create the solution.

The formula for teal: (CURRENT_BULLET / AMMO_CAPACITY) * 255

CURRENT_BULLET is how many shots are left in a gun
AMMO_CAPACITY is how many shots a gun can store
255 is the max value in the RGB table.

The formula has to:

satisfy for the formula of teal

share the value of CURRENT_BULLET and AMMO_CAPACITY from the first formula

the variable cannot have their own separate values

OH! Thanks for the tip, I never thought Color3.new() would just take the scale of the values. Because of that, I was able to look at the formula easily. Your tip didnâ€™t exactly find the solution, but I manage to find the formula which is:

I know this is resolved but this is all you would have needed to add.

Youâ€™d essentially be getting a ratio between the amount of ammo fired & the ammo capacity (which would be represent a percentage between 0%-100% as a decimal value, then youâ€™d multiply this decimal value by 255 before plugging it in the â€śColor3.fromRGBâ€ť constructor function.