Create a button dynamically and change its color

I am new in Godot and I cannot find a way to do a simple thing. I try to create a Button in code and set its color. So far, no luck. My latest attempt was to ask Meta AI for help and it suggested this:

var stylebox = StyleBoxFlat.new()
stylebox.bg_color = Color(0, 0, 1) # RGB for blue
var button = Button.new()
button.add_stylebox_override(“normal”, stylebox)

This fails: non_existant function ‘add_stylebox_override’ in base ‘Button.’

The error is always the same. Something is missing in the base class.

Try add_theme_stylebox_override

Thanks! That works.

Regards
Pekka