-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add DragValue
s for RGB(A) in the color picker
#2734
Conversation
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.
Co-authored-by: Emil Ernerfeldt <[email protected]>
I've applied the suggestions, had to work around the case when Additive blending is signaled with a negative alpha on Alpha::BlendOrAdditive. Given the negative alpha thing, users still can't switch to "Additive" blending when alpha is 0, even after this PR change. |
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.
Awesome, I'd really like this addition! To maybe help this further I gave it a review.
Remove unnecessary check on Alpha::Opaque for alpha_control Co-authored-by: Brian Janssen <[email protected]>
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.
Added another small nit i just realised. Also: Maybe it'd be good to support f32
drag values, since that would allow for HDR color pickers (which is my use case)?
Setting 3 decimal values seems the best option for the f32, but the layout would need a rearrange, also adding a button to switch between u8 and f32 appears necessary, which would require to add a new field needed to store the preferred choise (maybe to ui.style.visuals.). |
I've added the pub color_picker_input_values_type: ColorPickerInputType, field to style's Visuals. The resulting appearance definitely needs some polish, it would be better to put buttons and drag values into a StripBuilder, but it must be imported from the egui_extras crate. Help and advices are welcome. |
Would be nice seeing this implemented in. Also I'd suggest adding hex color field so it's easier to copy/paste, it could accept data in few formats |
DragValue
s for RGB(A) in the color picker
Added some DragValue widgets in the color_picker widget as input fields for managing the RGBA values.
In case the provided values result in a not valid premultiplied alpha RGBA color, a button will appear next to the input fields, to be used to multiply the values with the alpha channel.
Closes #2716.