Changing the Background Color

Relevant official examples: clear_color.


Click here for the full example code.


Use the ClearColor resource to choose the background color.

fn main() {
    App::build()
        .insert_resource(ClearColor(Color::rgb(0.4, 0.4, 0.4)))
        .add_plugins(DefaultPlugins)
        .run();
}