From a50f02a796efbbd1a08be1ddfcf2e013e20486b2 Mon Sep 17 00:00:00 2001 From: Pablo Reinhardt <126117294+pablo-lua@users.noreply.github.com> Date: Tue, 5 Mar 2024 14:50:16 -0300 Subject: [PATCH 1/4] Update docs.yml --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ee3c6d848c5af..322ad9231e465 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -3,7 +3,7 @@ name: Deploy Docs on: push: branches: - - 'main' + - 'test' # Allows running the action manually. workflow_dispatch: From bc9e72ecc564b0e3a9f7cdefca635c71f14cf0f3 Mon Sep 17 00:00:00 2001 From: pablo-lua Date: Sat, 16 Mar 2024 23:41:08 -0300 Subject: [PATCH 2/4] [add] Added reflection to Default trait --- crates/bevy_color/src/color.rs | 4 ++-- crates/bevy_color/src/hsla.rs | 4 ++-- crates/bevy_color/src/hsva.rs | 4 ++-- crates/bevy_color/src/hwba.rs | 4 ++-- crates/bevy_color/src/laba.rs | 4 ++-- crates/bevy_color/src/lcha.rs | 4 ++-- crates/bevy_color/src/linear_rgba.rs | 4 ++-- crates/bevy_color/src/oklaba.rs | 4 ++-- crates/bevy_color/src/oklcha.rs | 4 ++-- crates/bevy_color/src/srgba.rs | 4 ++-- crates/bevy_color/src/xyza.rs | 4 ++-- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/crates/bevy_color/src/color.rs b/crates/bevy_color/src/color.rs index bfb5118712289..0c7d826b09615 100644 --- a/crates/bevy_color/src/color.rs +++ b/crates/bevy_color/src/color.rs @@ -1,7 +1,7 @@ use crate::{ Alpha, Hsla, Hsva, Hwba, Laba, Lcha, LinearRgba, Oklaba, Oklcha, Srgba, StandardColor, Xyza, }; -use bevy_reflect::{Reflect, ReflectDeserialize, ReflectSerialize}; +use bevy_reflect::prelude::*; use serde::{Deserialize, Serialize}; /// An enumerated type that can represent any of the color types in this crate. @@ -13,7 +13,7 @@ use serde::{Deserialize, Serialize}; #[doc = include_str!("../docs/diagrams/model_graph.svg")] /// #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Reflect)] -#[reflect(PartialEq, Serialize, Deserialize)] +#[reflect(PartialEq, Serialize, Deserialize, Default)] pub enum Color { /// A color in the sRGB color space with alpha. Srgba(Srgba), diff --git a/crates/bevy_color/src/hsla.rs b/crates/bevy_color/src/hsla.rs index 2e31d5f9b1176..6da2b8e75fc1b 100644 --- a/crates/bevy_color/src/hsla.rs +++ b/crates/bevy_color/src/hsla.rs @@ -1,5 +1,5 @@ use crate::{Alpha, Hsva, Hwba, Lcha, LinearRgba, Luminance, Mix, Srgba, StandardColor, Xyza}; -use bevy_reflect::{Reflect, ReflectDeserialize, ReflectSerialize}; +use bevy_reflect::prelude::*; use serde::{Deserialize, Serialize}; /// Color in Hue-Saturation-Lightness (HSL) color space with alpha. @@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize}; #[doc = include_str!("../docs/diagrams/model_graph.svg")] /// #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Reflect)] -#[reflect(PartialEq, Serialize, Deserialize)] +#[reflect(PartialEq, Serialize, Deserialize,)] pub struct Hsla { /// The hue channel. [0.0, 360.0] pub hue: f32, diff --git a/crates/bevy_color/src/hsva.rs b/crates/bevy_color/src/hsva.rs index bc788c894863a..d895b157a593a 100644 --- a/crates/bevy_color/src/hsva.rs +++ b/crates/bevy_color/src/hsva.rs @@ -1,5 +1,5 @@ use crate::{Alpha, Hwba, Lcha, LinearRgba, Srgba, StandardColor, Xyza}; -use bevy_reflect::{Reflect, ReflectDeserialize, ReflectSerialize}; +use bevy_reflect::prelude::*; use serde::{Deserialize, Serialize}; /// Color in Hue-Saturation-Value (HSV) color space with alpha. @@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize}; #[doc = include_str!("../docs/diagrams/model_graph.svg")] /// #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Reflect)] -#[reflect(PartialEq, Serialize, Deserialize)] +#[reflect(PartialEq, Serialize, Deserialize, Default)] pub struct Hsva { /// The hue channel. [0.0, 360.0] pub hue: f32, diff --git a/crates/bevy_color/src/hwba.rs b/crates/bevy_color/src/hwba.rs index b3b7b6bf62ef9..a85f01b107c7c 100644 --- a/crates/bevy_color/src/hwba.rs +++ b/crates/bevy_color/src/hwba.rs @@ -3,7 +3,7 @@ //! //! [_HWB - A More Intuitive Hue-Based Color Model_]: https://web.archive.org/web/20240226005220/http://alvyray.com/Papers/CG/HWB_JGTv208.pdf use crate::{Alpha, Lcha, LinearRgba, Srgba, StandardColor, Xyza}; -use bevy_reflect::{Reflect, ReflectDeserialize, ReflectSerialize}; +use bevy_reflect::prelude::*; use serde::{Deserialize, Serialize}; /// Color in Hue-Whiteness-Blackness (HWB) color space with alpha. @@ -13,7 +13,7 @@ use serde::{Deserialize, Serialize}; #[doc = include_str!("../docs/diagrams/model_graph.svg")] /// #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Reflect)] -#[reflect(PartialEq, Serialize, Deserialize)] +#[reflect(PartialEq, Serialize, Deserialize, Default)] pub struct Hwba { /// The hue channel. [0.0, 360.0] pub hue: f32, diff --git a/crates/bevy_color/src/laba.rs b/crates/bevy_color/src/laba.rs index 31e8b643cc6ff..5b636665dc982 100644 --- a/crates/bevy_color/src/laba.rs +++ b/crates/bevy_color/src/laba.rs @@ -1,7 +1,7 @@ use crate::{ Alpha, Hsla, Hsva, Hwba, LinearRgba, Luminance, Mix, Oklaba, Srgba, StandardColor, Xyza, }; -use bevy_reflect::{Reflect, ReflectDeserialize, ReflectSerialize}; +use bevy_reflect::prelude::*; use serde::{Deserialize, Serialize}; /// Color in LAB color space, with alpha @@ -10,7 +10,7 @@ use serde::{Deserialize, Serialize}; #[doc = include_str!("../docs/diagrams/model_graph.svg")] /// #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Reflect)] -#[reflect(PartialEq, Serialize, Deserialize)] +#[reflect(PartialEq, Serialize, Deserialize, Default)] pub struct Laba { /// The lightness channel. [0.0, 1.5] pub lightness: f32, diff --git a/crates/bevy_color/src/lcha.rs b/crates/bevy_color/src/lcha.rs index d59698bedc53f..ea77ec49d7927 100644 --- a/crates/bevy_color/src/lcha.rs +++ b/crates/bevy_color/src/lcha.rs @@ -1,5 +1,5 @@ use crate::{Alpha, Laba, LinearRgba, Luminance, Mix, Srgba, StandardColor, Xyza}; -use bevy_reflect::{Reflect, ReflectDeserialize, ReflectSerialize}; +use bevy_reflect::prelude::*; use serde::{Deserialize, Serialize}; /// Color in LCH color space, with alpha @@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize}; #[doc = include_str!("../docs/diagrams/model_graph.svg")] /// #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Reflect)] -#[reflect(PartialEq, Serialize, Deserialize)] +#[reflect(PartialEq, Serialize, Deserialize, Default)] pub struct Lcha { /// The lightness channel. [0.0, 1.5] pub lightness: f32, diff --git a/crates/bevy_color/src/linear_rgba.rs b/crates/bevy_color/src/linear_rgba.rs index b07efa951e8ce..78856f36bd62f 100644 --- a/crates/bevy_color/src/linear_rgba.rs +++ b/crates/bevy_color/src/linear_rgba.rs @@ -2,7 +2,7 @@ use std::ops::{Div, Mul}; use crate::{color_difference::EuclideanDistance, Alpha, Luminance, Mix, StandardColor}; use bevy_math::Vec4; -use bevy_reflect::{Reflect, ReflectDeserialize, ReflectSerialize}; +use bevy_reflect::prelude::*; use bytemuck::{Pod, Zeroable}; use serde::{Deserialize, Serialize}; @@ -12,7 +12,7 @@ use serde::{Deserialize, Serialize}; #[doc = include_str!("../docs/diagrams/model_graph.svg")] /// #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Reflect)] -#[reflect(PartialEq, Serialize, Deserialize)] +#[reflect(PartialEq, Serialize, Deserialize, Default)] #[repr(C)] pub struct LinearRgba { /// The red channel. [0.0, 1.0] diff --git a/crates/bevy_color/src/oklaba.rs b/crates/bevy_color/src/oklaba.rs index 7bfeb8d996d5a..ed334d47f3bc4 100644 --- a/crates/bevy_color/src/oklaba.rs +++ b/crates/bevy_color/src/oklaba.rs @@ -2,7 +2,7 @@ use crate::{ color_difference::EuclideanDistance, Alpha, Hsla, Hsva, Hwba, Lcha, LinearRgba, Luminance, Mix, Srgba, StandardColor, Xyza, }; -use bevy_reflect::{Reflect, ReflectDeserialize, ReflectSerialize}; +use bevy_reflect::prelude::*; use serde::{Deserialize, Serialize}; /// Color in Oklab color space, with alpha @@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize}; #[doc = include_str!("../docs/diagrams/model_graph.svg")] /// #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Reflect)] -#[reflect(PartialEq, Serialize, Deserialize)] +#[reflect(PartialEq, Serialize, Deserialize, Default)] pub struct Oklaba { /// The 'l' channel. [0.0, 1.0] pub l: f32, diff --git a/crates/bevy_color/src/oklcha.rs b/crates/bevy_color/src/oklcha.rs index 939193a4ec1b9..0f05b30edb615 100644 --- a/crates/bevy_color/src/oklcha.rs +++ b/crates/bevy_color/src/oklcha.rs @@ -2,7 +2,7 @@ use crate::{ color_difference::EuclideanDistance, Alpha, Hsla, Hsva, Hwba, Laba, Lcha, LinearRgba, Luminance, Mix, Oklaba, Srgba, StandardColor, Xyza, }; -use bevy_reflect::{Reflect, ReflectDeserialize, ReflectSerialize}; +use bevy_reflect::prelude::*; use serde::{Deserialize, Serialize}; /// Color in Oklch color space, with alpha @@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize}; #[doc = include_str!("../docs/diagrams/model_graph.svg")] /// #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Reflect)] -#[reflect(PartialEq, Serialize, Deserialize)] +#[reflect(PartialEq, Serialize, Deserialize, Default)] pub struct Oklcha { /// The 'lightness' channel. [0.0, 1.0] pub lightness: f32, diff --git a/crates/bevy_color/src/srgba.rs b/crates/bevy_color/src/srgba.rs index 8479af4781daa..2101c5e5f2953 100644 --- a/crates/bevy_color/src/srgba.rs +++ b/crates/bevy_color/src/srgba.rs @@ -3,7 +3,7 @@ use std::ops::{Div, Mul}; use crate::color_difference::EuclideanDistance; use crate::{Alpha, LinearRgba, Luminance, Mix, StandardColor, Xyza}; use bevy_math::Vec4; -use bevy_reflect::{Reflect, ReflectDeserialize, ReflectSerialize}; +use bevy_reflect::prelude::*; use serde::{Deserialize, Serialize}; use thiserror::Error; @@ -13,7 +13,7 @@ use thiserror::Error; #[doc = include_str!("../docs/diagrams/model_graph.svg")] /// #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Reflect)] -#[reflect(PartialEq, Serialize, Deserialize)] +#[reflect(PartialEq, Serialize, Deserialize, Default)] pub struct Srgba { /// The red channel. [0.0, 1.0] pub red: f32, diff --git a/crates/bevy_color/src/xyza.rs b/crates/bevy_color/src/xyza.rs index 76bf27cef04b5..ff10c5eab218d 100644 --- a/crates/bevy_color/src/xyza.rs +++ b/crates/bevy_color/src/xyza.rs @@ -1,5 +1,5 @@ use crate::{Alpha, LinearRgba, Luminance, Mix, StandardColor}; -use bevy_reflect::{Reflect, ReflectDeserialize, ReflectSerialize}; +use bevy_reflect::prelude::*; use serde::{Deserialize, Serialize}; /// [CIE 1931](https://en.wikipedia.org/wiki/CIE_1931_color_space) color space, also known as XYZ, with an alpha channel. @@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize}; #[doc = include_str!("../docs/diagrams/model_graph.svg")] /// #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Reflect)] -#[reflect(PartialEq, Serialize, Deserialize)] +#[reflect(PartialEq, Serialize, Deserialize, Default)] pub struct Xyza { /// The x-axis. [0.0, 1.0] pub x: f32, From 4f7752f738221ace489320a8f2899bd4d5be15d6 Mon Sep 17 00:00:00 2001 From: pablo-lua Date: Sat, 16 Mar 2024 23:41:38 -0300 Subject: [PATCH 3/4] Revert "Update docs.yml" This reverts commit a50f02a796efbbd1a08be1ddfcf2e013e20486b2. --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 322ad9231e465..ee3c6d848c5af 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -3,7 +3,7 @@ name: Deploy Docs on: push: branches: - - 'test' + - 'main' # Allows running the action manually. workflow_dispatch: From 64ccb614c259806cd6982351f448115fa2d4d938 Mon Sep 17 00:00:00 2001 From: pablo-lua Date: Sat, 16 Mar 2024 23:44:29 -0300 Subject: [PATCH 4/4] [add] Added reflection to Default trait in forgotten type --- crates/bevy_color/src/hsla.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_color/src/hsla.rs b/crates/bevy_color/src/hsla.rs index 6da2b8e75fc1b..5e49b4dbffc48 100644 --- a/crates/bevy_color/src/hsla.rs +++ b/crates/bevy_color/src/hsla.rs @@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize}; #[doc = include_str!("../docs/diagrams/model_graph.svg")] /// #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Reflect)] -#[reflect(PartialEq, Serialize, Deserialize,)] +#[reflect(PartialEq, Serialize, Deserialize, Default)] pub struct Hsla { /// The hue channel. [0.0, 360.0] pub hue: f32,