diff --git a/src/curves/color_point.rs b/src/curves/color_point.rs index 0354221..f44a412 100644 --- a/src/curves/color_point.rs +++ b/src/curves/color_point.rs @@ -1,10 +1,10 @@ -use bevy::render::color::Color; +use bevy::{reflect::Reflect, render::color::Color}; use std::{ iter::Sum, ops::{Add, Deref, Mul, Sub}, }; -#[derive(Default, std::fmt::Debug, Clone, PartialEq, Copy)] +#[derive(Reflect, Default, Debug, Clone, PartialEq, Copy)] pub struct ColorPoint { pub color: Color, } @@ -85,3 +85,9 @@ impl Deref for ColorPoint { &self.color } } + +impl From for ColorPoint { + fn from(value: Color) -> Self { + Self { color: value } + } +} diff --git a/src/curves/constant.rs b/src/curves/constant.rs index b9b88f5..c14e027 100644 --- a/src/curves/constant.rs +++ b/src/curves/constant.rs @@ -1,7 +1,8 @@ use super::{curve::AsParamCurve, point::Point}; +use bevy::reflect::Reflect; use serde::{Deserialize, Serialize}; -#[derive(Serialize, Deserialize, Clone, Debug)] +#[derive(Reflect, Serialize, Deserialize, Clone, Debug)] pub struct ConstantParamCurve { val: P, } diff --git a/src/curves/point.rs b/src/curves/point.rs index 1499275..02fe5dc 100644 --- a/src/curves/point.rs +++ b/src/curves/point.rs @@ -1,3 +1,4 @@ +use super::color_point::ColorPoint; use bevy::math::prelude::*; use std::{ iter::Sum, @@ -21,3 +22,4 @@ pub trait Point: impl Point for f32 {} impl Point for Vec2 {} impl Point for Vec3 {} +impl Point for ColorPoint {}