diff --git a/doc/classes/ColorPicker.xml b/doc/classes/ColorPicker.xml index cf26f917e1..51c5c73207 100644 --- a/doc/classes/ColorPicker.xml +++ b/doc/classes/ColorPicker.xml @@ -70,12 +70,18 @@ If [code]true[/code], the color will apply only after the user releases the mouse button, otherwise it will apply immediately even in mouse motion event (which can cause performance issues). + + If [code]true[/code], [member old_color] will be displayed instead of [member color]. + If [code]true[/code], shows an alpha channel slider (opacity). If [code]true[/code], the hex color code input field is visible. + + The currently stored old color. See also [member display_old_color]. + The shape of the color space view. See [enum PickerShapeType]. diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index 1c6a191923..d9a116f94d 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -1735,6 +1735,10 @@ bool ColorPicker::is_hex_visible() const { void ColorPicker::_bind_methods() { ClassDB::bind_method(D_METHOD("set_pick_color", "color"), &ColorPicker::set_pick_color); ClassDB::bind_method(D_METHOD("get_pick_color"), &ColorPicker::get_pick_color); + ClassDB::bind_method(D_METHOD("set_old_color", "color"), &ColorPicker::set_old_color); + ClassDB::bind_method(D_METHOD("get_old_color"), &ColorPicker::get_old_color); + ClassDB::bind_method(D_METHOD("set_display_old_color", "display"), &ColorPicker::set_display_old_color); + ClassDB::bind_method(D_METHOD("is_displaying_old_color"), &ColorPicker::is_displaying_old_color); ClassDB::bind_method(D_METHOD("set_deferred_mode", "mode"), &ColorPicker::set_deferred_mode); ClassDB::bind_method(D_METHOD("is_deferred_mode"), &ColorPicker::is_deferred_mode); ClassDB::bind_method(D_METHOD("set_color_mode", "color_mode"), &ColorPicker::set_color_mode); @@ -1763,6 +1767,8 @@ void ColorPicker::_bind_methods() { ClassDB::bind_method(D_METHOD("get_picker_shape"), &ColorPicker::get_picker_shape); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "color"), "set_pick_color", "get_pick_color"); + ADD_PROPERTY(PropertyInfo(Variant::COLOR, "old_color"), "set_old_color", "get_old_color"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "display_old_color"), "set_display_old_color", "is_displaying_old_color"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "edit_alpha"), "set_edit_alpha", "is_editing_alpha"); ADD_PROPERTY(PropertyInfo(Variant::INT, "color_mode", PROPERTY_HINT_ENUM, "RGB,HSV,RAW,OKHSL"), "set_color_mode", "get_color_mode"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "deferred_mode"), "set_deferred_mode", "is_deferred_mode");