summaryrefslogtreecommitdiff
path: root/engine/src/color.rs
diff options
context:
space:
mode:
Diffstat (limited to 'engine/src/color.rs')
-rw-r--r--engine/src/color.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/engine/src/color.rs b/engine/src/color.rs
index 2fd2cd3..697ea8b 100644
--- a/engine/src/color.rs
+++ b/engine/src/color.rs
@@ -11,3 +11,15 @@ impl Color<f32>
{
pub const WHITE_F32: Self = Self { red: 1.0, green: 1.0, blue: 1.0 };
}
+
+impl<Value: Clone> From<Value> for Color<Value>
+{
+ fn from(value: Value) -> Self
+ {
+ Self {
+ red: value.clone(),
+ green: value.clone(),
+ blue: value,
+ }
+ }
+}