bevy14: fix warnings about deprecated Color::rgb(a) usage

This commit is contained in:
yuni 2024-07-09 02:32:38 +02:00
parent 3165cfd754
commit 18760e43c8
4 changed files with 4 additions and 4 deletions

View file

@ -925,7 +925,7 @@ fn spawn_entities(
if state.is_sun {
let (r, g, b) = nature::star_color_index_to_rgb(0.656);
actor.insert(materials.add(StandardMaterial {
base_color: Color::rgb(r, g, b) * 13.0,
base_color: Color::srgb(r, g, b) * 13.0,
unlit: true,
..default()
}));

View file

@ -121,7 +121,7 @@ impl AsteroidSurface {
pub fn material() -> ExtendedMaterial<StandardMaterial, AsteroidSurface> {
ExtendedMaterial {
base: StandardMaterial {
base_color: Color::rgb(0.29, 0.255, 0.208),
base_color: Color::srgb(0.29, 0.255, 0.208),
perceptual_roughness: 1.0,
opaque_render_method: OpaqueRendererMethod::Auto,
..default()

View file

@ -186,7 +186,7 @@ pub fn setup(
MenuElement,
NodeBundle {
style: style_fullscreen(),
background_color: Color::rgba(0.0, 0.0, 0.0, 0.8).into(),
background_color: Color::srgba(0.0, 0.0, 0.0, 0.8).into(),
visibility: Visibility::Hidden,
..default()
},

View file

@ -115,7 +115,7 @@ pub fn setup(
//(radius as f64 * nature::SOL_RADIUS).powf(0.02) as f32 *
let star_color_handle = materials.add(StandardMaterial {
base_color: Color::rgb(scale_color(r), scale_color(g), scale_color(b)),
base_color: Color::srgb(scale_color(r), scale_color(g), scale_color(b)),
unlit: true,
..default()
});