Hidden Lerp Function?

I don’t know how this works can someone explain it to me? I know it has three arguments color1, color2, lerpnumber but it seems broken.

local Lerp = Color3.fromRGB().Lerp
print(Lerp)

can someone explain this?

From looking at the Dev API, you need to pass a Color3 property (Frame’s BackgroundColor, Chat Color, etc) for the first argument then a float number for the second argument if you want to Lerp it properly?

Maybe something like this?

local RandomFrame = script.Parent.Frame

RandomFrame.BackgroundColor:Lerp(Color3.fromRGB(255, 0, 255), 0.5)

Just a guess

well this is kind of tricky to explain, but to my knowledge, the function returns a color that’s a percentage between 2 colors.
so say you have 1 color A and its Color3.fromRGB(255, 0,0), and another color B that’s Color3.fromRGB(0,0,255) and you do A:Lerp(B, .5) it will return a color that’s 50 percent between those two colors.

this might be hard to understand, but to be honest, I can’t think of a way to explain it better

You could put it through a loop & set the float argument to slowly increase its number, it’s kinda like a 1 color transition lol

local RandomFrame = script.Parent.Frame

for ColorPower = 0, 1, 0.05 do
    RandomFrame.BackgroundColor:Lerp(Color3.fromRGB(255, 0, 255), ColorPower)
    wait()
end

I believe that would be an easier way to understand it

1 Like

Yes, yes, yes. what this guy says.
think of it as color transition.

How to I have this interpolate like using Y values, normally I will make a lerp function and normalize the y position but is there a way not to do that and just use this function and the y value?