godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.14k stars 95 forks source link

Add properties to fold/hide away the Sliders and CheckButtons on ColorPicker #1962

Open EramarkMedia opened 3 years ago

EramarkMedia commented 3 years ago

Color_Pick

Describe the project you are working on

Simple click style 3D Enviroment, for showing a product.

Describe the problem or limitation you are having in your project

I would need only the square color selection part, as well as get the value of color. Looking for a way to exclude the color picker option "button", as well as RGB Sliders, and check buttons.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Adding simple color choose / mix function, thats about it.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Standard advanced color picker container, Click fold button, or alternatively menu option in editor, -> Simple color choose alternative. Just as Alpha slider can be disabled.

If this enhancement will not be used often, can it be worked around with a few lines of script?

Sure thing, but i dont think handling alot of random mixable colors is really optimal. Atleast not for Ui.

Is there a reason why this should be core and not an add-on in the asset library?

Feels like a clean / simple enough feature to be included? I dont think any gigantic changes are needed on source level, but i am not the right person to answer that question.

Just a little idea.

Take care & stay safe.

KoBeWi commented 3 years ago

You can access the internal controls of ColorPicker by using get_child(). It should be possible to manually hide them.

Wolfe2x7 commented 3 years ago

I came here to make about the same suggestion, and I've brought a solution and suggestions for default behavior. I just added a tutorial about this on the forum, so there's that.

As for the default behavior, I found it unintuitive for navigating a menu with a gamepad, because I could not actually select a color, only everything else. The RGB/HSV sliders are disallowed from acquiring focus by default (focus_mode == 0), for whatever reason.

The one node that really doesn't deserve focus is the "#" label, which is actually a button. In my project I've also hidden the "Raw" toggle because that's an abnormal feature for an end-user, and I changed the focus_mode on the LineEdits boxes and eyedropper to '1' because if you're going to use those, you can just click on them.

My suggestion for the defaults: eyedropper -- mode 2 -> mode 1 RGB/HSV sliders -- mode 0 -> mode 2 RGB/HSV spinbox/lineedit -- mode 2 -> mode 1 Hex '#' label -- mode 2 -> mode 0 Hex LineEdit -- mode 2 -> mode 1