From 618fa08aa5649e867c24db5ae941ca7f5064eeca Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Tue, 20 Aug 2024 11:43:32 +0300 Subject: Update Smithay (apply state in post commit) --- niri-config/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'niri-config/src') 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] } -- cgit