Skip to content
Discussion options

You must be logged in to vote

You can style the size of the popup, but I don't think you can directly configure the color picker, so it doesn't look quite right. I suggest making a custom widget/popup.

if button_response.clicked() {
    ui.memory_mut(|mem| mem.toggle_popup(egui::Id::new("color_picker")));
}
            
egui::popup::popup_below_widget(
    ui,
    egui::Id::new("color_picker"),
    &button_response,
    egui::popup::PopupCloseBehavior::CloseOnClickOutside,
    |ui| {
        ui.set_max_size(vec2(0., 0.));
        egui::color_picker::color_picker_color32(ui, &mut self.brush_color, Alpha::Opaque);
    }
);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by NotQuiteApex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants