How do I change the color of GUI elements?

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

Hello Everyone,

I have been looking through the documentation for a way to change the color of UI controls and found the Theme.set_color() method. But, I cannot find a list of the colors that I can change; I only know of ‘font_color’, which was used in the example.

So my questions are:

  1. Is setting a control’s Theme the best/only way to set a control’s color?
  2. Where can I find a list of the colors that I can change using Theme.set_color()

Thanks for helping the new guy.

:bust_in_silhouette: Reply From: umfk

Creating a theme is good because it’s an easy way to make a coherent… well theme… for all UI elements.

Color is actually a class. Check the docs here. You have different ways to create your color.

Thank you, that answers my first question.
Do you know where the list of names and types are that can used to call the Theme.set_color() method?

set_color ( String name, String type, Color color )

unknown llama | 2016-03-01 01:55

I haven’t used themes myself yet but I just had a quick look at the docs and they say that name is the name of the property you want to set. So for example if you want to change a button just check all of the propoerties the button class has. Type is the name of the control, so for example “Button”.

Also here is the docs page for Control. I think all GUI controls inherit from this base node, so you can just click on them to see all their properties.

Control — Godot Engine (latest) documentation in English

umfk | 2016-03-01 02:00

Perfect, now I understand. Thanks!

unknown llama | 2016-03-01 02:10