How do i add to Color3?

How do i add numbers to color3? I tried to do

object.Color = object.Color + Color3.fromRGB(10,0,0)

And it didn’t work.

I believe there are 2 ways.

  1. using Color3:lerp() idk how to use it so cant demonstrate.
  2. Using the Color3’s R G and B variables to add on.
object.Color = Color3.fromRGB(object.Color.R + 10, object.Color.G, object.Color.B)
1 Like

You could Lerp the two colour3s.

Such as:

object.Color:Lerp(Color3.fromRGB(10,0,0), 0.5)

Surprisingly there is no __add metamethod on Color3 objects to do this.

Break the Color3 color apart and add the components individually.

local ColorA = Color3.new(1, .5, .25)
local ColorB = Color3.new(0, .1, .5)
local ColorC = Color3.new(ColorA.R + ColorB.R, ColorA.G + ColorB.G, ColorA.B + ColorB.B)