Godot 4 released this year so most of what ChatGPT is spitting out is Godot 3 code which is usually not compatible. That is if it doesn't just give you complete nonsense. I wouldn't recommend using it much.
What you're looking for is a Tween. This can slowly change one value to another, and you can use it for colors. Something like:
var tween: Tween = create_tween()
tween.tween_property($RichTextLabel, "modulate", Color.BLUE, 1)
This will change the label's color from what it is now to blue over the course of one second. You can mess around with set_ease()
and set_trans()
to make the effect smoother if you need to.