Skip to content

Change background color of a single ui element #4902

Closed Answered by chianti-ga
chianti-ga asked this question in Q&A
Discussion options

You must be logged in to vote

i found a way to do it

let frame = egui::Frame::none()
    .fill(hex_color!("#262626"))
    .rounding(Rounding {
        nw: 25.0,
        ne: 25.0,
        sw: 25.0,
        se: 25.0,
    })
    .inner_margin(Margin {
        left: 10.0,
        right: 10.0,
        top: 10.0,
        bottom: 10.0,
    }).outer_margin(Margin {
    left: 10.0,
    right: 10.0,
    top: 10.0,
    bottom: 10.0,
});

    frame.show(ui, |ui| {
        ui.vertical(|ui| {
        //blablabla
        });
    });
     

Replies: 1 comment

Comment options

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