From 50e8bf8642c9f0e9047f5d23a601963fc7ca34df Mon Sep 17 00:00:00 2001 From: Joona Aalto Date: Sat, 26 Oct 2024 03:41:25 +0300 Subject: [PATCH 1/2] Change Z axis color --- crates/bevy_infinite_grid/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_infinite_grid/src/lib.rs b/crates/bevy_infinite_grid/src/lib.rs index ef0ddbdf..67ea0103 100644 --- a/crates/bevy_infinite_grid/src/lib.rs +++ b/crates/bevy_infinite_grid/src/lib.rs @@ -43,7 +43,7 @@ impl Default for InfiniteGridSettings { fn default() -> Self { Self { x_axis_color: Color::srgb(1.0, 0.2, 0.2), - z_axis_color: Color::srgb(0.2, 0.2, 1.0), + z_axis_color: Color::srgb(0.175, 0.55, 1.0), minor_line_color: Color::srgb(0.1, 0.1, 0.1), major_line_color: Color::srgb(0.25, 0.25, 0.25), fadeout_distance: 100., From c485f7f3853e34d3fe2520ec4aa168315767a934 Mon Sep 17 00:00:00 2001 From: Joona Aalto Date: Sat, 26 Oct 2024 04:18:00 +0300 Subject: [PATCH 2/2] Move axis colors to `ViewportStyles` and use oklch --- bevy_editor_panes/bevy_2d_viewport/src/lib.rs | 3 ++- bevy_editor_panes/bevy_3d_viewport/src/lib.rs | 2 ++ crates/bevy_editor_styles/src/lib.rs | 9 +++++++++ crates/bevy_infinite_grid/src/lib.rs | 4 ++-- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/bevy_editor_panes/bevy_2d_viewport/src/lib.rs b/bevy_editor_panes/bevy_2d_viewport/src/lib.rs index 1fbdada7..657cfbf6 100644 --- a/bevy_editor_panes/bevy_2d_viewport/src/lib.rs +++ b/bevy_editor_panes/bevy_2d_viewport/src/lib.rs @@ -68,7 +68,8 @@ fn setup(mut commands: Commands, theme: Res) { InfiniteGridSettings { scale: 0.01, dot_fadeout_strength: 0., - z_axis_color: Color::srgb(0.2, 8., 0.3), + x_axis_color: theme.viewport.x_axis_color, + z_axis_color: theme.viewport.y_axis_color, major_line_color: theme.viewport.grid_major_line_color, minor_line_color: theme.viewport.grid_minor_line_color, ..default() diff --git a/bevy_editor_panes/bevy_3d_viewport/src/lib.rs b/bevy_editor_panes/bevy_3d_viewport/src/lib.rs index 2875ab39..1621957e 100644 --- a/bevy_editor_panes/bevy_3d_viewport/src/lib.rs +++ b/bevy_editor_panes/bevy_3d_viewport/src/lib.rs @@ -131,6 +131,8 @@ fn setup(mut commands: Commands, theme: Res) { commands.spawn(( InfiniteGrid, InfiniteGridSettings { + x_axis_color: theme.viewport.x_axis_color, + z_axis_color: theme.viewport.z_axis_color, major_line_color: theme.viewport.grid_major_line_color, minor_line_color: theme.viewport.grid_minor_line_color, ..default() diff --git a/crates/bevy_editor_styles/src/lib.rs b/crates/bevy_editor_styles/src/lib.rs index 787881b8..7aa343e0 100644 --- a/crates/bevy_editor_styles/src/lib.rs +++ b/crates/bevy_editor_styles/src/lib.rs @@ -92,6 +92,12 @@ pub struct ContextMenuStyles { pub struct ViewportStyles { /// The background color of the viewports. pub background_color: Color, + /// The color of the x-axis. + pub x_axis_color: Color, + /// The color of the y-axis. + pub y_axis_color: Color, + /// The color of the z-axis. + pub z_axis_color: Color, /// The color of the major grid lines. pub grid_major_line_color: Color, /// The color of the minor grid lines. @@ -142,6 +148,9 @@ impl FromWorld for Theme { }, viewport: ViewportStyles { background_color: Color::oklch(0.3677, 0.0, 0.0), + x_axis_color: Color::oklch(0.65, 0.24, 27.0), + y_axis_color: Color::oklch(0.87, 0.27, 144.0), + z_axis_color: Color::oklch(0.65, 0.19, 255.0), grid_major_line_color: Color::oklch(0.45, 0.0, 0.0), grid_minor_line_color: Color::oklch(0.4, 0.0, 0.0), }, diff --git a/crates/bevy_infinite_grid/src/lib.rs b/crates/bevy_infinite_grid/src/lib.rs index 67ea0103..786b0509 100644 --- a/crates/bevy_infinite_grid/src/lib.rs +++ b/crates/bevy_infinite_grid/src/lib.rs @@ -42,8 +42,8 @@ pub struct InfiniteGridSettings { impl Default for InfiniteGridSettings { fn default() -> Self { Self { - x_axis_color: Color::srgb(1.0, 0.2, 0.2), - z_axis_color: Color::srgb(0.175, 0.55, 1.0), + x_axis_color: Color::oklch(0.65, 0.24, 27.0), + z_axis_color: Color::oklch(0.65, 0.19, 255.0), minor_line_color: Color::srgb(0.1, 0.1, 0.1), major_line_color: Color::srgb(0.25, 0.25, 0.25), fadeout_distance: 100.,