mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
Fix "dark grey" colors becoming lighter in various examples (#12333)
# Objective Fixes #12226 Prior to the `bevy_color` port, `DARK GRAY` used to mean "dark grey." But it is now lighter than `GRAY`, matching the css4 spec. ## Solution Change usages of `css::DARK_GRAY` to `Color::srgb(0.25, 0.25, 0.25)` to restore the examples to their former colors. With one exception: `display_and_visibility`. I think the new color is an improvement. ## Note A lot of these examples could use nicer colors. I'm not trying to revamp everything here. The css4 palette is truly a horror. See #12176 and #12080 for some discussion about alternatives.
This commit is contained in:
parent
0746b8eb4c
commit
d56e16754c
6 changed files with 9 additions and 12 deletions
|
@ -3,8 +3,7 @@
|
|||
use std::f32::consts::PI;
|
||||
|
||||
use bevy::{
|
||||
color::palettes::css::DARK_GRAY, pbr::CascadeShadowConfigBuilder, prelude::*,
|
||||
render::camera::Viewport, window::WindowResized,
|
||||
pbr::CascadeShadowConfigBuilder, prelude::*, render::camera::Viewport, window::WindowResized,
|
||||
};
|
||||
|
||||
fn main() {
|
||||
|
@ -147,7 +146,7 @@ fn setup(
|
|||
..default()
|
||||
},
|
||||
border_color: Color::WHITE.into(),
|
||||
image: UiImage::default().with_color(DARK_GRAY.into()),
|
||||
image: UiImage::default().with_color(Color::srgb(0.25, 0.25, 0.25)),
|
||||
..default()
|
||||
},
|
||||
))
|
||||
|
|
|
@ -23,7 +23,7 @@ fn setup(mut commands: Commands) {
|
|||
align_content: AlignContent::FlexStart,
|
||||
..Default::default()
|
||||
},
|
||||
background_color: DARK_GRAY.into(),
|
||||
background_color: Color::srgb(0.25, 0.25, 0.25).into(),
|
||||
..Default::default()
|
||||
})
|
||||
.id();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//! Demonstrates how the `AlignItems` and `JustifyContent` properties can be composed to layout text.
|
||||
use bevy::{color::palettes::css::DARK_GRAY, prelude::*};
|
||||
use bevy::prelude::*;
|
||||
|
||||
const ALIGN_ITEMS_COLOR: Color = Color::srgb(1., 0.066, 0.349);
|
||||
const JUSTIFY_CONTENT_COLOR: Color = Color::srgb(0.102, 0.522, 1.);
|
||||
|
@ -134,7 +134,7 @@ fn spawn_child_node(
|
|||
height: Val::Percent(100.),
|
||||
..Default::default()
|
||||
},
|
||||
background_color: BackgroundColor(DARK_GRAY.into()),
|
||||
background_color: BackgroundColor(Color::srgb(0.25, 0.25, 0.25)),
|
||||
..Default::default()
|
||||
})
|
||||
.with_children(|builder| {
|
||||
|
|
|
@ -87,7 +87,7 @@ fn spawn_layout(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||
column_gap: Val::Px(12.0),
|
||||
..default()
|
||||
},
|
||||
background_color: BackgroundColor(DARK_GRAY.into()),
|
||||
background_color: BackgroundColor(Color::srgb(0.25, 0.25, 0.25)),
|
||||
..default()
|
||||
})
|
||||
.with_children(|builder| {
|
||||
|
|
|
@ -61,7 +61,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||
margin: UiRect::bottom(Val::Px(25.)),
|
||||
..Default::default()
|
||||
},
|
||||
background_color: DARK_GRAY.into(),
|
||||
background_color: Color::srgb(0.25, 0.25, 0.25).into(),
|
||||
..Default::default()
|
||||
})
|
||||
.with_children(|parent| {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
//! Tests how different transforms behave when clipped with `Overflow::Hidden`
|
||||
use bevy::{
|
||||
color::palettes::css::DARK_GRAY, input::common_conditions::input_just_pressed, prelude::*,
|
||||
};
|
||||
use bevy::{input::common_conditions::input_just_pressed, prelude::*};
|
||||
use std::f32::consts::{FRAC_PI_2, PI, TAU};
|
||||
|
||||
const CONTAINER_SIZE: f32 = 150.0;
|
||||
|
@ -198,7 +196,7 @@ fn spawn_container(
|
|||
overflow: Overflow::clip(),
|
||||
..default()
|
||||
},
|
||||
background_color: DARK_GRAY.into(),
|
||||
background_color: Color::srgb(0.25, 0.25, 0.25).into(),
|
||||
..default()
|
||||
},
|
||||
Container(0),
|
||||
|
|
Loading…
Reference in a new issue