+6 votes
in Engine by (20 points)

4 Answers

+13 votes

get_node("Label").add_color_override("font_color", Color(1,0,0,1))

enter image description here

by (9,760 points)
+8 votes



any parameter that doesn't have a direct getter or setter method can be accessed through
get(-the path hint you get when mousing over any parameter-)
e.g "custom_colors/font_color"

get() also needs a second parameter witch is what you want to change
e.g Color(1,0,0)

by (36 points)
edited by

Can you change a property of the color directly? e.g. the alpha? If so, how?

+3 votes

get_node("Label").set("custom_colors/default_color", Color(1,1,1,1))

The above would be white text.

by (24 points)

Thanks, this was very helpful. I assume things have been updated since 2017 as none of the other answers worked!

Thanks. It's a bit of trial and error sometimes. I'll try to contribute as much as I can. All the best!

0 votes

I was able to change font color with modulate property.

lbl.modulate =  Color(1, 0, 1)
by (104 points)

I guess this works, but if the font color of the label isn't white, then the new color won't be the exact color displayed.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.