diff options
Diffstat (limited to 'engine/src/data_types')
| -rw-r--r-- | engine/src/data_types/color.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/engine/src/data_types/color.rs b/engine/src/data_types/color.rs index 9664507..d2fd217 100644 --- a/engine/src/data_types/color.rs +++ b/engine/src/data_types/color.rs @@ -1,5 +1,7 @@ use std::ops::{Add, Div, Mul, Sub}; +use crate::reflection::Reflection; + pub trait Pixel: sealed::Sealed { type Component: PixelComponent; @@ -12,7 +14,8 @@ pub trait PixelComponent: Clone + Copy + sealed::Sealed macro_rules! gen_color { ($ident: ident, components=($($component: ident),+)) => { - #[derive(Debug, Clone, Default)] + #[derive(Debug, Clone, Default, Reflection)] + #[reflection(impl_with_generics(<u8>, <u16>, <u32>, <f32>))] pub struct $ident<Component> { $(pub $component: Component),+ @@ -40,7 +43,8 @@ macro_rules! gen_color { gen_color!(Rgb, components = (r, g, b)); gen_color!(Rgba, components = (r, g, b, a)); -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Reflection)] +#[reflection(impl_with_generics(<u8>, <u16>, <u32>, <f32>))] pub enum Color<Component> { Rgb(Rgb<Component>), |
