From 14bd4580f580f36920bc2ea465592bfc08b50b2b Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 20 Aug 2026 19:12:47 +0200 Subject: feat(engine): add reflection derive to color types --- engine/src/data_types/color.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'engine/src') 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(, , , ))] pub struct $ident { $(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(, , , ))] pub enum Color { Rgb(Rgb), -- cgit v1.2.3-18-g5258