-
-
Notifications
You must be signed in to change notification settings - Fork 23.5k
Refactor ColorPicker shapes #99515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor ColorPicker shapes #99515
Conversation
029beba to
04e059f
Compare
|
I reimplemented the input. The shapes should behave the same as before. I'll be probably changing the shapes to be Object, because the current code is far from ideal and the little saved memory is not worth it. |
42c56a6 to
dd5783d
Compare
|
Rebased. There were many changes to ColorPicker in the meantime, hopefully I didn't accidentally revert anything. |
1c17182 to
bcafac0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally (in the editor and a minimal project), it mostly works as expected.
I spotted one functional regression though. ColorPickerButton with the OKHSL slider mode (not the color wheel mode) will have the color wheel disappear entirely, while a standalone ColorPicker with the same setting is fine.
| Before | After |
|---|---|
![]() |
![]() |
|
Good catch, fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great now 🙂
Code looks good to me.
|
Thanks! |



Closes godotengine/godot-proposals#4353
Basically #62075, but for picker shapes.
Adds a new class ColorPickerShape, which is an abstraction of picker shapes (similar to ColorMode). This allows to split some behemoth methods into a more manageable pieces. For now I removed the huge
_hsv_draw()method, which had entangled code for drawing every piece of ColorPicker. Now each part has its own method. The shapes should appear as before.