ChocolateBird/widgets/ColorMenu.gd

26 lines
532 B
GDScript

extends Panel
var r := 0
var g := 0
var b := 16
func update_menu_color() -> void:
$label_nums.text = '\n%d\n%d\n%d' % [r, g, b]
ThemeManager.set_menu_color_555(r, g, b)
func _ready() -> void:
$'%slider_r'.value = r
$'%slider_g'.value = g
$'%slider_b'.value = b
func _on_slider_r_value_changed(value: float) -> void:
r = value
update_menu_color()
func _on_slider_g_value_changed(value: float) -> void:
g = value
update_menu_color()
func _on_slider_b_value_changed(value: float) -> void:
b = value
update_menu_color()