Invalid assignment of property or key 'icon_pressed_color' with value of type 'Color'

Godot Version

4.6.1

Question

var booster_button = Button.new()
var booster_img := Image.load_from_file("res://Assets/Booster_stuff/"+i+"/icon_2rare.png")
booster_img.resize(40, 40, Image.INTERPOLATE_LANCZOS)
booster_button.icon = (ImageTexture.create_from_image(booster_img))
booster_button.toggle_mode = (true)

booster_button.icon_pressed_color = Color(0.0, 0.97, 0.097, 0.8)

$ScrollContainer/VBoxContainer.add_child(booster_button)

I don’t even know what else to say, how is “color” not the right value for “icon_pressed_color” (i tried with and without putting it brackets already, same error)

icon_pressed_color is not a property of a button. It’s part of a theme. You’ll need a theme override.

icon_pressed_color is a theme override, the docs are oddly displaying it as if it’s a normal property but you have to set it through .set or .add_theme_color_override; I prefer .set because right-clicking the property in the inspector gives the “Copy Property Path” option

$Button.add_theme_color_override("icon_pressed_color", Color.RED)
$Button.set("theme_override_colors/icon_pressed_color", Color.RED)

Huh, yeah i was following the documentation and was very confused thank you i never woulda guessed.