Godot Version
4.2.1
Question
Here is the structure of the code (simple):
I am trying to assign a modified StyleBoxFlat style property to the ‘Color’ panel in the structure, but no matter what i try, it doesn’t work
This is simplified version of what i am trying to do and what methods i already tried
extends Control
func _ready():
var style_box = StyleBoxFlat.new()
style_box.bg_color = Color8(255, 209, 0, 255) # make background yellow
$Color.set_theme(style_box) # doesn't work
$Color.add_theme_stylebox_override("styles", style_box) # does not work as well
as you can see, i tried only two methods i found on the other help posts, but they both do not work, the panel still remains that semi-transparent black rectangle.
How do i assign a StyleBox to panel through code?