From bd36b85000ef4fb7dc8144e5a3ec2aae59eb1ee3 Mon Sep 17 00:00:00 2001 From: Patrick Zhao Date: Sat, 6 Jul 2024 17:17:54 +0200 Subject: [PATCH] Use RED, LIME, BLUE from bevy::color::palettes::css & Into Addresses Bevy #12163 (https://github.com/bevyengine/bevy/pull/12163) --- crates/transform-gizmo-bevy/examples/bevy_minimal.rs | 3 ++- examples/bevy/src/main.rs | 2 +- examples/bevy/src/scene.rs | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/transform-gizmo-bevy/examples/bevy_minimal.rs b/crates/transform-gizmo-bevy/examples/bevy_minimal.rs index 24e287b..c31893e 100644 --- a/crates/transform-gizmo-bevy/examples/bevy_minimal.rs +++ b/crates/transform-gizmo-bevy/examples/bevy_minimal.rs @@ -1,6 +1,7 @@ //! A very simple example //! See the project root's `examples` directory for more examples +use bevy::color::palettes::css::LIME; use bevy::prelude::*; use transform_gizmo_bevy::*; @@ -30,7 +31,7 @@ fn setup( commands.spawn(( PbrBundle { mesh: meshes.add(Cuboid::new(1.0, 1.0, 1.0)), - material: materials.add(Color::GREEN), + material: materials.add(Color::from(LIME)), transform: Transform::from_translation(Vec3::new(0.0, 0.0, 0.0)), ..default() }, diff --git a/examples/bevy/src/main.rs b/examples/bevy/src/main.rs index 9f592d7..2a26d7a 100644 --- a/examples/bevy/src/main.rs +++ b/examples/bevy/src/main.rs @@ -15,7 +15,7 @@ mod scene; fn main() { App::new() - .insert_resource(ClearColor(Color::rgb_u8(20, 20, 20))) + .insert_resource(ClearColor(Color::srgb_u8(20, 20, 20))) .add_plugins(DefaultPlugins.set(WindowPlugin { primary_window: Some(Window { title: "transform-gizmo-demo".into(), diff --git a/examples/bevy/src/scene.rs b/examples/bevy/src/scene.rs index daacdba..54ec037 100644 --- a/examples/bevy/src/scene.rs +++ b/examples/bevy/src/scene.rs @@ -1,3 +1,4 @@ +use bevy::color::palettes::css::{BLUE, LIME, RED}; use bevy::prelude::*; use bevy_mod_outline::*; use bevy_mod_picking::prelude::*; @@ -37,7 +38,7 @@ fn setup_scene( let cube_count: i32 = 3; - let colors = [Color::RED, Color::GREEN, Color::BLUE]; + let colors: [Color; 3] = [RED.into(), LIME.into(), BLUE.into()]; for i in 0..cube_count { commands