summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'core/src')
-rw-r--r--core/src/color.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/src/color.rs b/core/src/color.rs
index 79910dd8..150bd05b 100644
--- a/core/src/color.rs
+++ b/core/src/color.rs
@@ -44,3 +44,15 @@ impl Color {
]
}
}
+
+impl From<[f32; 3]> for Color {
+ fn from([r, g, b]: [f32; 3]) -> Self {
+ Color { r, g, b, a: 1.0 }
+ }
+}
+
+impl From<[f32; 4]> for Color {
+ fn from([r, g, b, a]: [f32; 4]) -> Self {
+ Color { r, g, b, a }
+ }
+}