Fix green colors becoming darker in various examples (#12328)
# Objective Fixes #12225 Prior to the `bevy_color` port, `GREEN` used to mean "full green." But it is now a much darker color matching the css1 spec. ## Solution Change usages of `basic::GREEN` or `css::GREEN` to `LIME` to restore the examples to their former colors. This also removes the duplicate definition of `GREEN` from `css`. (it was already re-exported from `basic`) ## Note A lot of these examples could use nicer colors. I'm not trying to do that here. "Dark Grey" will be tackled separately and has its own tracking issue.
This commit is contained in:
parent
ba9d1eff41
commit
0746b8eb4c
@ -106,8 +106,6 @@ pub const GOLD: Srgba = Srgba::new(1.0, 0.843, 0.0, 1.0);
|
|||||||
/// <div style="background-color:rgb(85.5%, 64.7%, 12.5%); width: 10px; padding: 10px; border: 1px solid;"></div>
|
/// <div style="background-color:rgb(85.5%, 64.7%, 12.5%); width: 10px; padding: 10px; border: 1px solid;"></div>
|
||||||
pub const GOLDENROD: Srgba = Srgba::new(0.855, 0.647, 0.125, 1.0);
|
pub const GOLDENROD: Srgba = Srgba::new(0.855, 0.647, 0.125, 1.0);
|
||||||
/// <div style="background-color:rgb(0.0%, 50.2%, 0.0%); width: 10px; padding: 10px; border: 1px solid;"></div>
|
/// <div style="background-color:rgb(0.0%, 50.2%, 0.0%); width: 10px; padding: 10px; border: 1px solid;"></div>
|
||||||
pub const GREEN: Srgba = Srgba::new(0.0, 0.502, 0.0, 1.0);
|
|
||||||
/// <div style="background-color:rgb(67.80000000000001%, 100.0%, 18.4%); width: 10px; padding: 10px; border: 1px solid;"></div>
|
|
||||||
pub const GREEN_YELLOW: Srgba = Srgba::new(0.678, 1.0, 0.184, 1.0);
|
pub const GREEN_YELLOW: Srgba = Srgba::new(0.678, 1.0, 0.184, 1.0);
|
||||||
/// <div style="background-color:rgb(50.2%, 50.2%, 50.2%); width: 10px; padding: 10px; border: 1px solid;"></div>
|
/// <div style="background-color:rgb(50.2%, 50.2%, 50.2%); width: 10px; padding: 10px; border: 1px solid;"></div>
|
||||||
pub const GREY: Srgba = Srgba::new(0.502, 0.502, 0.502, 1.0);
|
pub const GREY: Srgba = Srgba::new(0.502, 0.502, 0.502, 1.0);
|
||||||
|
@ -324,11 +324,7 @@ fn ray_cast_system(
|
|||||||
**intersects = toi.is_some();
|
**intersects = toi.is_some();
|
||||||
if let Some(toi) = toi {
|
if let Some(toi) = toi {
|
||||||
for r in [1., 2., 3.] {
|
for r in [1., 2., 3.] {
|
||||||
gizmos.circle_2d(
|
gizmos.circle_2d(ray_cast.ray.origin + *ray_cast.ray.direction * toi, r, LIME);
|
||||||
ray_cast.ray.origin + *ray_cast.ray.direction * toi,
|
|
||||||
r,
|
|
||||||
GREEN,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -359,7 +355,7 @@ fn aabb_cast_system(
|
|||||||
+ aabb_cast.aabb.center(),
|
+ aabb_cast.aabb.center(),
|
||||||
0.,
|
0.,
|
||||||
aabb_cast.aabb.half_size() * 2.,
|
aabb_cast.aabb.half_size() * 2.,
|
||||||
GREEN,
|
LIME,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -389,7 +385,7 @@ fn bounding_circle_cast_system(
|
|||||||
+ *circle_cast.ray.ray.direction * toi
|
+ *circle_cast.ray.ray.direction * toi
|
||||||
+ circle_cast.circle.center(),
|
+ circle_cast.circle.center(),
|
||||||
circle_cast.circle.radius(),
|
circle_cast.circle.radius(),
|
||||||
GREEN,
|
LIME,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
|
|
||||||
for (text_anchor, color) in [
|
for (text_anchor, color) in [
|
||||||
(Anchor::TopLeft, Color::Srgba(RED)),
|
(Anchor::TopLeft, Color::Srgba(RED)),
|
||||||
(Anchor::TopRight, Color::Srgba(GREEN)),
|
(Anchor::TopRight, Color::Srgba(LIME)),
|
||||||
(Anchor::BottomRight, Color::Srgba(BLUE)),
|
(Anchor::BottomRight, Color::Srgba(BLUE)),
|
||||||
(Anchor::BottomLeft, Color::Srgba(YELLOW)),
|
(Anchor::BottomLeft, Color::Srgba(YELLOW)),
|
||||||
] {
|
] {
|
||||||
|
@ -159,7 +159,7 @@ fn setup(
|
|||||||
.looking_at(Vec3::new(-1.0, 0.0, 0.0), Vec3::Z),
|
.looking_at(Vec3::new(-1.0, 0.0, 0.0), Vec3::Z),
|
||||||
spot_light: SpotLight {
|
spot_light: SpotLight {
|
||||||
intensity: 100_000.0,
|
intensity: 100_000.0,
|
||||||
color: GREEN.into(),
|
color: LIME.into(),
|
||||||
shadows_enabled: true,
|
shadows_enabled: true,
|
||||||
inner_angle: 0.6,
|
inner_angle: 0.6,
|
||||||
outer_angle: 0.8,
|
outer_angle: 0.8,
|
||||||
@ -172,7 +172,7 @@ fn setup(
|
|||||||
transform: Transform::from_rotation(Quat::from_rotation_x(PI / 2.0)),
|
transform: Transform::from_rotation(Quat::from_rotation_x(PI / 2.0)),
|
||||||
mesh: meshes.add(Capsule3d::new(0.1, 0.125)),
|
mesh: meshes.add(Capsule3d::new(0.1, 0.125)),
|
||||||
material: materials.add(StandardMaterial {
|
material: materials.add(StandardMaterial {
|
||||||
base_color: GREEN.into(),
|
base_color: LIME.into(),
|
||||||
emissive: Color::linear_rgba(0.0, 7.13, 0.0, 0.0),
|
emissive: Color::linear_rgba(0.0, 7.13, 0.0, 0.0),
|
||||||
..default()
|
..default()
|
||||||
}),
|
}),
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
use std::f32::consts::PI;
|
use std::f32::consts::PI;
|
||||||
|
|
||||||
use bevy::{
|
use bevy::{
|
||||||
color::palettes::basic::{BLUE, GREEN, RED},
|
color::palettes::basic::{BLUE, LIME, RED},
|
||||||
pbr::{light_consts, CascadeShadowConfigBuilder, NotShadowCaster, NotShadowReceiver},
|
pbr::{light_consts, CascadeShadowConfigBuilder, NotShadowCaster, NotShadowReceiver},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
};
|
};
|
||||||
@ -62,7 +62,7 @@ fn setup(
|
|||||||
commands.spawn((
|
commands.spawn((
|
||||||
PbrBundle {
|
PbrBundle {
|
||||||
mesh: meshes.add(Plane3d::default().mesh().size(20.0, 20.0)),
|
mesh: meshes.add(Plane3d::default().mesh().size(20.0, 20.0)),
|
||||||
material: materials.add(Color::from(GREEN)),
|
material: materials.add(Color::from(LIME)),
|
||||||
transform: Transform::from_xyz(0.0, 1.0, -10.0),
|
transform: Transform::from_xyz(0.0, 1.0, -10.0),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
|
@ -213,7 +213,7 @@ fn setup(
|
|||||||
PbrBundle {
|
PbrBundle {
|
||||||
mesh: icosphere_mesh.clone(),
|
mesh: icosphere_mesh.clone(),
|
||||||
material: materials.add(StandardMaterial {
|
material: materials.add(StandardMaterial {
|
||||||
base_color: GREEN.into(),
|
base_color: LIME.into(),
|
||||||
specular_transmission: 0.9,
|
specular_transmission: 0.9,
|
||||||
diffuse_transmission: 1.0,
|
diffuse_transmission: 1.0,
|
||||||
thickness: 1.8,
|
thickness: 1.8,
|
||||||
|
@ -82,16 +82,14 @@ fn setup(
|
|||||||
commands.spawn((
|
commands.spawn((
|
||||||
PbrBundle {
|
PbrBundle {
|
||||||
mesh: meshes.add(Cuboid::default()),
|
mesh: meshes.add(Cuboid::default()),
|
||||||
material: materials.add(Color::from(GREEN)),
|
material: materials.add(Color::from(LIME)),
|
||||||
transform: Transform::from_xyz(1.0, 0.5, 1.0),
|
transform: Transform::from_xyz(1.0, 0.5, 1.0),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
Wireframe,
|
Wireframe,
|
||||||
// This lets you configure the wireframe color of this entity.
|
// This lets you configure the wireframe color of this entity.
|
||||||
// If not set, this will use the color in `WireframeConfig`
|
// If not set, this will use the color in `WireframeConfig`
|
||||||
WireframeColor {
|
WireframeColor { color: LIME.into() },
|
||||||
color: GREEN.into(),
|
|
||||||
},
|
|
||||||
));
|
));
|
||||||
|
|
||||||
// light
|
// light
|
||||||
@ -157,10 +155,10 @@ Color: {:?}
|
|||||||
// Toggle the color of a wireframe using WireframeColor and not the global color
|
// Toggle the color of a wireframe using WireframeColor and not the global color
|
||||||
if keyboard_input.just_pressed(KeyCode::KeyC) {
|
if keyboard_input.just_pressed(KeyCode::KeyC) {
|
||||||
for mut color in &mut wireframe_colors {
|
for mut color in &mut wireframe_colors {
|
||||||
color.color = if color.color == GREEN.into() {
|
color.color = if color.color == LIME.into() {
|
||||||
RED.into()
|
RED.into()
|
||||||
} else {
|
} else {
|
||||||
GREEN.into()
|
LIME.into()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ fn setup(
|
|||||||
// right ear
|
// right ear
|
||||||
parent.spawn(SpriteBundle {
|
parent.spawn(SpriteBundle {
|
||||||
sprite: Sprite {
|
sprite: Sprite {
|
||||||
color: GREEN.into(),
|
color: LIME.into(),
|
||||||
custom_size: Some(Vec2::splat(20.0)),
|
custom_size: Some(Vec2::splat(20.0)),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//! This example illustrates how to load and play an audio file, and control where the sounds seems to come from.
|
//! This example illustrates how to load and play an audio file, and control where the sounds seems to come from.
|
||||||
use bevy::{
|
use bevy::{
|
||||||
color::palettes::basic::{BLUE, GREEN, RED},
|
color::palettes::basic::{BLUE, LIME, RED},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ fn setup(
|
|||||||
// right ear indicator
|
// right ear indicator
|
||||||
parent.spawn(PbrBundle {
|
parent.spawn(PbrBundle {
|
||||||
mesh: meshes.add(Cuboid::new(0.2, 0.2, 0.2)),
|
mesh: meshes.add(Cuboid::new(0.2, 0.2, 0.2)),
|
||||||
material: materials.add(Color::from(GREEN)),
|
material: materials.add(Color::from(LIME)),
|
||||||
transform: Transform::from_translation(listener.right_ear_offset),
|
transform: Transform::from_translation(listener.right_ear_offset),
|
||||||
..default()
|
..default()
|
||||||
});
|
});
|
||||||
|
@ -47,7 +47,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
transform: Transform::from_xyz(0.0, 250.0, 0.0).with_scale(Vec3::splat(0.75)),
|
transform: Transform::from_xyz(0.0, 250.0, 0.0).with_scale(Vec3::splat(0.75)),
|
||||||
texture,
|
texture,
|
||||||
sprite: Sprite {
|
sprite: Sprite {
|
||||||
color: GREEN.into(),
|
color: LIME.into(),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
..default()
|
..default()
|
||||||
|
@ -116,7 +116,7 @@ mod splash {
|
|||||||
|
|
||||||
mod game {
|
mod game {
|
||||||
use bevy::{
|
use bevy::{
|
||||||
color::palettes::basic::{BLUE, GREEN},
|
color::palettes::basic::{BLUE, LIME},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -211,7 +211,7 @@ mod game {
|
|||||||
format!("volume: {:?}", *volume),
|
format!("volume: {:?}", *volume),
|
||||||
TextStyle {
|
TextStyle {
|
||||||
font_size: 60.0,
|
font_size: 60.0,
|
||||||
color: GREEN.into(),
|
color: LIME.into(),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@ -39,7 +39,7 @@ fn draw_example_collection(
|
|||||||
) {
|
) {
|
||||||
let sin = time.elapsed_seconds().sin() * 50.;
|
let sin = time.elapsed_seconds().sin() * 50.;
|
||||||
gizmos.line_2d(Vec2::Y * -sin, Vec2::splat(-80.), RED);
|
gizmos.line_2d(Vec2::Y * -sin, Vec2::splat(-80.), RED);
|
||||||
gizmos.ray_2d(Vec2::Y * sin, Vec2::splat(80.), GREEN);
|
gizmos.ray_2d(Vec2::Y * sin, Vec2::splat(80.), LIME);
|
||||||
|
|
||||||
gizmos
|
gizmos
|
||||||
.grid_2d(
|
.grid_2d(
|
||||||
@ -56,7 +56,7 @@ fn draw_example_collection(
|
|||||||
gizmos.linestrip_gradient_2d([
|
gizmos.linestrip_gradient_2d([
|
||||||
(Vec2::Y * 300., BLUE),
|
(Vec2::Y * 300., BLUE),
|
||||||
(Vec2::new(-255., -155.), RED),
|
(Vec2::new(-255., -155.), RED),
|
||||||
(Vec2::new(255., -155.), GREEN),
|
(Vec2::new(255., -155.), LIME),
|
||||||
(Vec2::Y * 300., BLUE),
|
(Vec2::Y * 300., BLUE),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ fn draw_example_collection(
|
|||||||
Vec3::new(time.elapsed_seconds().cos() * 2.5, 1., 0.),
|
Vec3::new(time.elapsed_seconds().cos() * 2.5, 1., 0.),
|
||||||
Quat::from_rotation_y(PI / 2.),
|
Quat::from_rotation_y(PI / 2.),
|
||||||
Vec2::splat(2.),
|
Vec2::splat(2.),
|
||||||
GREEN,
|
LIME,
|
||||||
);
|
);
|
||||||
|
|
||||||
my_gizmos.sphere(Vec3::new(1., 0.5, 0.), Quat::IDENTITY, 0.5, RED);
|
my_gizmos.sphere(Vec3::new(1., 0.5, 0.), Quat::IDENTITY, 0.5, RED);
|
||||||
|
@ -253,13 +253,13 @@ fn setup(
|
|||||||
.with_children(|c| {
|
.with_children(|c| {
|
||||||
c.spawn((
|
c.spawn((
|
||||||
TextBundle::from_sections([
|
TextBundle::from_sections([
|
||||||
text_section(GREEN, "Bird Count: "),
|
text_section(LIME, "Bird Count: "),
|
||||||
text_section(AQUA, ""),
|
text_section(AQUA, ""),
|
||||||
text_section(GREEN, "\nFPS (raw): "),
|
text_section(LIME, "\nFPS (raw): "),
|
||||||
text_section(AQUA, ""),
|
text_section(AQUA, ""),
|
||||||
text_section(GREEN, "\nFPS (SMA): "),
|
text_section(LIME, "\nFPS (SMA): "),
|
||||||
text_section(AQUA, ""),
|
text_section(AQUA, ""),
|
||||||
text_section(GREEN, "\nFPS (EMA): "),
|
text_section(LIME, "\nFPS (EMA): "),
|
||||||
text_section(AQUA, ""),
|
text_section(AQUA, ""),
|
||||||
]),
|
]),
|
||||||
StatsText,
|
StatsText,
|
||||||
|
@ -170,7 +170,7 @@ fn infotext_system(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
TextSection::from_style(TextStyle {
|
TextSection::from_style(TextStyle {
|
||||||
font: font.clone(),
|
font: font.clone(),
|
||||||
font_size: 25.0,
|
font_size: 25.0,
|
||||||
color: GREEN.into(),
|
color: LIME.into(),
|
||||||
}),
|
}),
|
||||||
TextSection::new(
|
TextSection::new(
|
||||||
" ms/frame",
|
" ms/frame",
|
||||||
|
@ -5,7 +5,7 @@ use bevy::{
|
|||||||
accesskit::{NodeBuilder, Role},
|
accesskit::{NodeBuilder, Role},
|
||||||
AccessibilityNode,
|
AccessibilityNode,
|
||||||
},
|
},
|
||||||
color::palettes::basic::GREEN,
|
color::palettes::basic::LIME,
|
||||||
input::mouse::{MouseScrollUnit, MouseWheel},
|
input::mouse::{MouseScrollUnit, MouseWheel},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
winit::WinitSettings,
|
winit::WinitSettings,
|
||||||
@ -166,7 +166,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
border: UiRect::all(Val::Px(20.)),
|
border: UiRect::all(Val::Px(20.)),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
border_color: GREEN.into(),
|
border_color: LIME.into(),
|
||||||
background_color: Color::srgb(0.4, 0.4, 1.).into(),
|
background_color: Color::srgb(0.4, 0.4, 1.).into(),
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
use bevy::{color::palettes::css::*, prelude::*};
|
use bevy::{color::palettes::css::*, prelude::*};
|
||||||
|
|
||||||
const PALETTE: [Srgba; 10] = [
|
const PALETTE: [Srgba; 10] = [
|
||||||
RED, YELLOW, WHITE, BEIGE, AQUA, CRIMSON, NAVY, AZURE, GREEN, BLACK,
|
RED, YELLOW, WHITE, BEIGE, AQUA, CRIMSON, NAVY, AZURE, LIME, BLACK,
|
||||||
];
|
];
|
||||||
|
|
||||||
#[derive(Component, Default, PartialEq)]
|
#[derive(Component, Default, PartialEq)]
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
//! depth of nodes compared to their siblings, but also compared to the entire UI.
|
//! depth of nodes compared to their siblings, but also compared to the entire UI.
|
||||||
|
|
||||||
use bevy::{
|
use bevy::{
|
||||||
color::palettes::basic::{BLUE, GRAY, GREEN, PURPLE, RED, YELLOW},
|
color::palettes::basic::{BLUE, GRAY, LIME, PURPLE, RED, YELLOW},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ fn setup(mut commands: Commands) {
|
|||||||
// it will show under other nodes in the gray container.
|
// it will show under other nodes in the gray container.
|
||||||
parent.spawn(NodeBundle {
|
parent.spawn(NodeBundle {
|
||||||
z_index: ZIndex::Local(-1),
|
z_index: ZIndex::Local(-1),
|
||||||
background_color: GREEN.into(),
|
background_color: LIME.into(),
|
||||||
style: Style {
|
style: Style {
|
||||||
position_type: PositionType::Absolute,
|
position_type: PositionType::Absolute,
|
||||||
left: Val::Px(70.0),
|
left: Val::Px(70.0),
|
||||||
|
@ -93,7 +93,7 @@ fn update_winit(
|
|||||||
pub(crate) mod test_setup {
|
pub(crate) mod test_setup {
|
||||||
use crate::ExampleMode;
|
use crate::ExampleMode;
|
||||||
use bevy::{
|
use bevy::{
|
||||||
color::palettes::basic::{GREEN, YELLOW},
|
color::palettes::basic::{LIME, YELLOW},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
window::RequestRedraw,
|
window::RequestRedraw,
|
||||||
};
|
};
|
||||||
@ -181,7 +181,7 @@ pub(crate) mod test_setup {
|
|||||||
),
|
),
|
||||||
TextSection::from_style(TextStyle {
|
TextSection::from_style(TextStyle {
|
||||||
font_size: 50.0,
|
font_size: 50.0,
|
||||||
color: GREEN.into(),
|
color: LIME.into(),
|
||||||
..default()
|
..default()
|
||||||
}),
|
}),
|
||||||
TextSection::new(
|
TextSection::new(
|
||||||
|
Loading…
Reference in New Issue
Block a user