Skip to content

Commit

Permalink
Update default ClearColor
Browse files Browse the repository at this point in the history
  • Loading branch information
aevyrie committed Nov 1, 2023
1 parent 6f8848a commit 8686330
Show file tree
Hide file tree
Showing 31 changed files with 34 additions and 48 deletions.
3 changes: 2 additions & 1 deletion crates/bevy_core_pipeline/src/clear_color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pub struct ClearColor(pub Color);

impl Default for ClearColor {
fn default() -> Self {
Self(Color::rgb(0.4, 0.4, 0.4))
// Match the bevy website code block color by default.
Self(Color::rgb_u8(43, 44, 47))
}
}
1 change: 0 additions & 1 deletion examples/2d/bloom_2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use bevy::{

fn main() {
App::new()
.insert_resource(ClearColor(Color::DARK_GRAY))
.add_plugins(DefaultPlugins)
.add_systems(Startup, setup)
.add_systems(Update, update_bloom_settings)
Expand Down
9 changes: 5 additions & 4 deletions examples/3d/3d_scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ fn setup(
) {
// plane
commands.spawn(PbrBundle {
mesh: meshes.add(shape::Plane::from_size(5.0).into()),
material: materials.add(Color::rgb(0.3, 0.5, 0.3).into()),
mesh: meshes.add(shape::Circle::new(4.0).into()),
material: materials.add(Color::WHITE.into()),
transform: Transform::from_rotation(Quat::from_rotation_x(-std::f32::consts::FRAC_PI_2)),
..default()
});
// cube
commands.spawn(PbrBundle {
mesh: meshes.add(Mesh::from(shape::Cube { size: 1.0 })),
material: materials.add(Color::rgb(0.8, 0.7, 0.6).into()),
material: materials.add(Color::rgb_u8(124, 144, 255).into()),
transform: Transform::from_xyz(0.0, 0.5, 0.0),
..default()
});
Expand All @@ -40,7 +41,7 @@ fn setup(
});
// camera
commands.spawn(Camera3dBundle {
transform: Transform::from_xyz(-2.0, 2.5, 5.0).looking_at(Vec3::ZERO, Vec3::Y),
transform: Transform::from_xyz(-2.5, 4.5, 9.0).looking_at(Vec3::ZERO, Vec3::Y),
..default()
});
}
1 change: 0 additions & 1 deletion examples/3d/atmospheric_fog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ fn setup_instructions(mut commands: Commands) {
"Press Spacebar to Toggle Atmospheric Fog.\nPress S to Toggle Directional Light Fog Influence.",
TextStyle {
font_size: 20.0,
color: Color::WHITE,
..default()
},
)
Expand Down
2 changes: 1 addition & 1 deletion examples/3d/blend_modes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ fn setup(
let text_style = TextStyle {
font: asset_server.load("fonts/FiraMono-Medium.ttf"),
font_size: 18.0,
color: Color::BLACK,
..default()
};

let label_text_style = TextStyle {
Expand Down
1 change: 0 additions & 1 deletion examples/3d/bloom_3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use std::{

fn main() {
App::new()
.insert_resource(ClearColor(Color::DARK_GRAY))
.add_plugins(DefaultPlugins)
.add_systems(Startup, setup_scene)
.add_systems(Update, (update_bloom_settings, bounce_spheres))
Expand Down
1 change: 0 additions & 1 deletion examples/3d/deferred_rendering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ fn setup(
"",
TextStyle {
font_size: 18.0,
color: Color::WHITE,
..default()
},
)
Expand Down
2 changes: 0 additions & 2 deletions examples/3d/pbr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ fn setup(
"Perceptual Roughness",
TextStyle {
font_size: 36.0,
color: Color::WHITE,
..default()
},
)
Expand All @@ -91,7 +90,6 @@ fn setup(
"Metallic",
TextStyle {
font_size: 36.0,
color: Color::WHITE,
..default()
},
),
Expand Down
1 change: 0 additions & 1 deletion examples/3d/spherical_area_lights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use bevy::prelude::*;

fn main() {
App::new()
.insert_resource(ClearColor(Color::BLACK))
.add_plugins(DefaultPlugins)
.add_systems(Startup, setup)
.run();
Expand Down
2 changes: 1 addition & 1 deletion examples/3d/ssao.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ fn setup(
TextStyle {
font: asset_server.load("fonts/FiraMono-Medium.ttf"),
font_size: 26.0,
color: Color::BLACK,
..default()
},
)
.with_style(Style {
Expand Down
1 change: 0 additions & 1 deletion examples/3d/tonemapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ fn setup(
"",
TextStyle {
font_size: 18.0,
color: Color::WHITE,
..default()
},
)
Expand Down
4 changes: 2 additions & 2 deletions examples/games/contributors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
TextStyle {
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
font_size: 60.0,
color: Color::WHITE,
..default()
},
),
TextSection::from_style(TextStyle {
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
font_size: 60.0,
color: Color::WHITE,
..default()
}),
])
.with_style(Style {
Expand Down
14 changes: 7 additions & 7 deletions examples/input/text_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,47 +39,47 @@ fn setup_scene(mut commands: Commands, asset_server: Res<AssetServer>) {
style: TextStyle {
font: font.clone_weak(),
font_size: 20.0,
color: Color::WHITE,
..default()
},
},
TextSection {
value: "false\n".to_string(),
style: TextStyle {
font: font.clone_weak(),
font_size: 30.0,
color: Color::WHITE,
..default()
},
},
TextSection {
value: "IME Active: ".to_string(),
style: TextStyle {
font: font.clone_weak(),
font_size: 20.0,
color: Color::WHITE,
..default()
},
},
TextSection {
value: "false\n".to_string(),
style: TextStyle {
font: font.clone_weak(),
font_size: 30.0,
color: Color::WHITE,
..default()
},
},
TextSection {
value: "click to toggle IME, press return to start a new line\n\n".to_string(),
style: TextStyle {
font: font.clone_weak(),
font_size: 18.0,
color: Color::WHITE,
..default()
},
},
TextSection {
value: "".to_string(),
style: TextStyle {
font,
font_size: 25.0,
color: Color::WHITE,
..default()
},
},
])
Expand All @@ -97,7 +97,7 @@ fn setup_scene(mut commands: Commands, asset_server: Res<AssetServer>) {
TextStyle {
font: asset_server.load("fonts/FiraMono-Medium.ttf"),
font_size: 100.0,
color: Color::WHITE,
..default()
},
),
..default()
Expand Down
1 change: 0 additions & 1 deletion examples/scene/scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ fn infotext_system(mut commands: Commands) {
"Nothing to see in this window! Check the console output!",
TextStyle {
font_size: 50.0,
color: Color::WHITE,
..default()
},
)
Expand Down
1 change: 0 additions & 1 deletion examples/shader/shader_prepass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ fn setup(

let style = TextStyle {
font_size: 18.0,
color: Color::WHITE,
..default()
};

Expand Down
1 change: 0 additions & 1 deletion examples/stress_tests/many_glyphs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ fn setup(mut commands: Commands) {
value: "0123456789".repeat(10_000),
style: TextStyle {
font_size: 4.,
color: Color::WHITE,
..default()
},
}],
Expand Down
2 changes: 1 addition & 1 deletion examples/tools/scene_viewer/morph_viewer_plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ fn detect_morphs(
let style = TextStyle {
font: asset_server.load("assets/fonts/FiraMono-Medium.ttf"),
font_size: 13.0,
color: Color::WHITE,
..default()
};
let mut sections = vec![
TextSection::new("Morph Target Controls\n", style.clone()),
Expand Down
4 changes: 2 additions & 2 deletions examples/ui/display_and_visibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
let text_style = TextStyle {
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
font_size: 24.0,
color: Color::WHITE,
..default()
};

commands.spawn(Camera2dBundle::default());
Expand Down Expand Up @@ -151,7 +151,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
let text_style = TextStyle {
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
font_size: 20.0,
color: Color::WHITE,
..default()
};

builder.spawn(TextBundle {
Expand Down
4 changes: 2 additions & 2 deletions examples/ui/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,15 @@ fn spawn_layout(mut commands: Commands, asset_server: Res<AssetServer>) {
TextStyle {
font: font.clone(),
font_size: 24.0,
color: Color::WHITE,
..default()
},
));
builder.spawn(TextBundle::from_section(
"A paragraph of text which ought to wrap nicely. A paragraph of text which ought to wrap nicely. A paragraph of text which ought to wrap nicely. A paragraph of text which ought to wrap nicely. A paragraph of text which ought to wrap nicely. A paragraph of text which ought to wrap nicely. A paragraph of text which ought to wrap nicely.",
TextStyle {
font: font.clone(),
font_size: 16.0,
color: Color::WHITE,
..default()
},
));
builder.spawn(NodeBundle::default());
Expand Down
2 changes: 1 addition & 1 deletion examples/ui/overflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
let text_style = TextStyle {
font: asset_server.load("fonts/FiraMono-Medium.ttf"),
font_size: 20.0,
color: Color::WHITE,
..default()
};

let image = asset_server.load("branding/icon.png");
Expand Down
4 changes: 2 additions & 2 deletions examples/ui/overflow_debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
TextStyle {
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
font_size: 18.0,
color: Color::WHITE,
..default()
},
));
});
Expand Down Expand Up @@ -185,7 +185,7 @@ fn spawn_text(
TextStyle {
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
font_size: 120.0,
color: Color::WHITE,
..default()
},
));
});
Expand Down
4 changes: 2 additions & 2 deletions examples/ui/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
// This font is loaded and will be used instead of the default font.
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
font_size: 100.0,
color: Color::WHITE,
..default()
},
) // Set the alignment of the Text
.with_text_alignment(TextAlignment::Center)
Expand All @@ -61,7 +61,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
// This font is loaded and will be used instead of the default font.
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
font_size: 60.0,
color: Color::WHITE,
..default()
},
),
TextSection::from_style(if cfg!(feature = "default_font") {
Expand Down
2 changes: 1 addition & 1 deletion examples/ui/text_debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn infotext_system(mut commands: Commands, asset_server: Res<AssetServer>) {
TextStyle {
font: font.clone(),
font_size: 50.0,
color: Color::WHITE,
..default()
},
)
.with_style(Style {
Expand Down
2 changes: 1 addition & 1 deletion examples/ui/text_wrap_debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn spawn(mut commands: Commands, asset_server: Res<AssetServer>) {
let text_style = TextStyle {
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
font_size: 14.0,
color: Color::WHITE,
..default()
};

let root = commands
Expand Down
6 changes: 3 additions & 3 deletions examples/ui/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
TextStyle {
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
font_size: 30.0,
color: Color::WHITE,
..default()
},
)
.with_style(Style {
Expand Down Expand Up @@ -101,7 +101,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
TextStyle {
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
font_size: 25.,
color: Color::WHITE,
..default()
},
),
Label,
Expand Down Expand Up @@ -144,7 +144,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
font: asset_server
.load("fonts/FiraSans-Bold.ttf"),
font_size: 20.,
color: Color::WHITE,
..default()
},
),
Label,
Expand Down
1 change: 0 additions & 1 deletion examples/ui/ui_texture_atlas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ fn setup(
commands.spawn(Camera2dBundle::default());

let text_style = TextStyle {
color: Color::ANTIQUE_WHITE,
font_size: 20.,
..default()
};
Expand Down
2 changes: 1 addition & 1 deletion examples/ui/window_fallthrough.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
TextStyle {
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
font_size: 100.0, // Nice and big so you can see it!
color: Color::WHITE,
..default()
},
)
// Set the style of the TextBundle itself.
Expand Down
1 change: 0 additions & 1 deletion examples/window/low_power.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ pub(crate) mod test_setup {
"Press spacebar to cycle modes\n",
TextStyle {
font_size: 50.0,
color: Color::WHITE,
..default()
},
),
Expand Down
1 change: 0 additions & 1 deletion examples/window/scale_factor_override.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ fn setup(mut commands: Commands) {
"Example text",
TextStyle {
font_size: 30.0,
color: Color::WHITE,
..default()
},
)
Expand Down
1 change: 0 additions & 1 deletion examples/window/screenshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ fn setup(
"Press <spacebar> to save a screenshot to disk",
TextStyle {
font_size: 25.0,
color: Color::WHITE,
..default()
},
)
Expand Down
Loading

0 comments on commit 8686330

Please sign in to comment.