Add DragValues for RGB(A) in the color picker - #2734
Conversation
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
|
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. |
tosti007
left a comment
There was a problem hiding this comment.
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 <tosti007@users.noreply.github.com>
tosti007
left a comment
There was a problem hiding this comment.
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 |
DragValues 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.