diff options
Diffstat (limited to 'niri-config/src')
| -rw-r--r-- | niri-config/src/lib.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/niri-config/src/lib.rs b/niri-config/src/lib.rs index b9edf4ce..7afb4fc0 100644 --- a/niri-config/src/lib.rs +++ b/niri-config/src/lib.rs @@ -13,6 +13,7 @@ use knuffel::Decode as _; use miette::{miette, Context, IntoDiagnostic, NarratableReportHandler}; use niri_ipc::{ConfiguredMode, LayoutSwitchTarget, SizeChange, Transform, WorkspaceReferenceArg}; use regex::Regex; +use smithay::backend::renderer::Color32F; use smithay::input::keyboard::keysyms::KEY_NoSymbol; use smithay::input::keyboard::xkb::{keysym_from_name, KEYSYM_CASE_INSENSITIVE}; use smithay::input::keyboard::{Keysym, XkbConfig}; @@ -580,6 +581,10 @@ impl Color { Self { r, g, b, a } } + pub fn from_color32f(color: Color32F) -> Self { + Self::from_array_premul(color.components()) + } + pub fn to_array_unpremul(self) -> [f32; 4] { [self.r, self.g, self.b, self.a] } |
