Skip to content

Commit

Permalink
Use RED, LIME, BLUE from bevy::color::palettes::css & Into<Color>
Browse files Browse the repository at this point in the history
Addresses Bevy #12163 (bevyengine/bevy#12163)
  • Loading branch information
zhaop committed Jul 6, 2024
1 parent 317add5 commit bd36b85
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion crates/transform-gizmo-bevy/examples/bevy_minimal.rs
Original file line number Diff line number Diff line change
@@ -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::*;

Expand Down Expand Up @@ -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()
},
Expand Down
2 changes: 1 addition & 1 deletion examples/bevy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
3 changes: 2 additions & 1 deletion examples/bevy/src/scene.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use bevy::color::palettes::css::{BLUE, LIME, RED};
use bevy::prelude::*;
use bevy_mod_outline::*;
use bevy_mod_picking::prelude::*;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bd36b85

Please sign in to comment.