Fading from black to white in Color3

I’ve been trying to fade from black to white using Color3.fromRGB, but when I try this I get a green tinge until the Color3 is (255, 255, 255). Does anyone know how to make it so that it simply fades from (0,0,0) to (255, 255, 255) without a green tinge? I have tried .fromHSV too and this did not work.

2 Likes

You can use Color3.fromRGB(0,0,0):Lerp(Color3.fromRGB(255,255,255)).

Just tried this, it didn’t work.

Instead of just replying It didn’t work, could you describe what exactly isn’t working?

1 Like

Can you post the code you used? I don’t see any green when I do this:

game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.BackgroundColor3 = Color3.fromRGB(0, 0, 0):Lerp(Color3.fromRGB(255, 255, 255))

Are you using a local script or server script?

A local script.

Color3.Lerp returns an interpolated Color value between two Colors by an alpha value (between 0 and 1). In your example, you are just setting the Frame’s BackgroundColor3 to a single color, rather than using Lerp in something like a loop to change it over time.

I’m not sure what your use case is but I think you’ll find it easier to use TweenService here rather than manually setting the properties in a loop.

2 Likes

Sorry I should have said this to begin with, but I’m not trying to fade. When a player clicks something the RGB changes by a certain amount, slowly revealing the image as they they click more things. Here is the code I use for this: image.ImageColor3 =
Color3.new((255/(7-progress))/255, (255/(6-progress))/255, (255/(7-progress))/255)
, where progress is a number between 0 and 6. When I do this I get a slight green tinge until the progress value is 6 (the color3 value is (255, 255, 255)).

1 Like

You use 7-progress and 6-progress - perhaps you made a typo and they should all either be 7- or 6-?

1 Like

This is not correct. His issue is not related to this at all.

Oh my goodness! I really should double check things! Thank you so much.

1 Like

My bad. Sorry.

1 Like