From 4e43c8ba01e12c0b038e21df27b28f30d5c88d83 Mon Sep 17 00:00:00 2001 From: Ivan Smirnov Date: Mon, 3 Jan 2022 12:00:18 +0300 Subject: [PATCH] Add ColorSpace::as_u8() --- src/types.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/types.rs b/src/types.rs index b5c271c..65a5cd1 100644 --- a/src/types.rs +++ b/src/types.rs @@ -24,6 +24,10 @@ impl ColorSpace { pub const fn is_linear(self) -> bool { matches!(self, Self::Linear) } + + pub const fn as_u8(self) -> u8 { + self as u8 + } } impl Default for ColorSpace {