From 67128704ff794e83ceaf70c10caa3e3b037355fc Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 4 Aug 2018 11:07:27 -0700 Subject: [PATCH] add helper to extract the srgba tuple without converting to linear --- src/color.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/color.rs b/src/color.rs index 99dc086d3..73959d9f9 100644 --- a/src/color.rs +++ b/src/color.rs @@ -74,6 +74,11 @@ impl RgbColor { .into_linear() } + pub fn to_tuple_rgba(&self) -> RgbaTuple { + Srgba::::new(self.red, self.green, self.blue, 0xff) + .into_format().into_components() + } + pub fn to_linear_tuple_rgba(&self) -> RgbaTuple { self.to_linear().into_components() }