From d44a2bae53ea8028f0611534d579011921b2d6a6 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Sun, 24 Mar 2024 01:10:22 +0100 Subject: [PATCH] impl from corners vec3 --- hui/src/rect/color.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hui/src/rect/color.rs b/hui/src/rect/color.rs index acbe104..f19470e 100644 --- a/hui/src/rect/color.rs +++ b/hui/src/rect/color.rs @@ -153,6 +153,17 @@ impl From<[[f32; 4]; 4]> for FillColor { } } +impl From> for FillColor { + fn from(corners: Corners) -> Self { + Self(Corners { + top_left: corners.top_left.extend(1.), + top_right: corners.top_right.extend(1.), + bottom_left: corners.bottom_left.extend(1.), + bottom_right: corners.bottom_right.extend(1.), + }) + } +} + impl From<(Vec3, Vec3, Vec3, Vec3)> for FillColor { fn from((top_left, top_right, bottom_left, bottom_right): (Vec3, Vec3, Vec3, Vec3)) -> Self { Self(Corners {