How to change a button color in theme with gdscript

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By I reject all deals

Hi I have a theme.tres file and in this theme I customized the buttons background color
For example I want to change button hover background color in theme.tres and I want to
do it with gdscript. How I can do this?


This code is not working but its not giving error also.

:bust_in_silhouette: Reply From: lostlivio

This example will set the color to firebrick red. Don’t forget to replace $StartButton with the name of your button

var styleBox = $StartButton.get(“custom_styles/normal/bg_color”)
styleBox.bg_color = Color.firebrick