Skip to content

How to change CentralPanel background color only #1286

Answered by mjehrhart
mjehrhart asked this question in Q&A
Discussion options

You must be logged in to vote

Solution!

   let my_frame = egui::containers::Frame {
              margin: egui::style::Margin { left: 10., right: 10., top: 10., bottom: 10. },
              rounding: egui::Rounding { nw: 1.0, ne: 1.0, sw: 1.0, se: 1.0 },
              shadow: eframe::epaint::Shadow { extrusion: 1.0, color: Color32::YELLOW },
              fill: Color32::LIGHT_BLUE,
              stroke: egui::Stroke::new(2.0, Color32::GOLD),
          };
   egui::CentralPanel::default().frame(my_frame).show(ctx, |ui| {});

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by mjehrhart
Comment options

You must be logged in to vote
0 replies
Comment options

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