How to change the color of the Label?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By DimitriyPS
:warning: Old Version Published before Godot 3 was released.

In the object inspector I can change color separately the taken Label.
enter image description here

But I don’t see a method to do that in GDScript. Tell me how to do it in GDScript.

:bust_in_silhouette: Reply From: volzhs
label.add_color_override("font_color", Color(1,0,0,1))

Is it safe to call this multiple times? The add naming confuses me :s
Also, how can I get this color? When I use get_color("font_color") it returns white instead of what I set in the editor…

Zylann | 2016-07-17 18:44

how can we remove the color_override?

digitalsin | 2017-11-10 19:52

@Zylann

var color = get_node("Label").get("custom_colors/font_color")	

@digitalsin

get_node("Label").set("custom_colors/font_color", null)

volzhs | 2017-11-11 03:33