diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-08-20 11:43:32 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-08-22 14:15:04 +0300 |
| commit | 618fa08aa5649e867c24db5ae941ca7f5064eeca (patch) | |
| tree | 085dbbd37c3069c258c33f819fcfcd5ea3868a8a /niri-config/src | |
| parent | a40e7b44707692335910532c33e41cad0023844e (diff) | |
| download | niri-618fa08aa5649e867c24db5ae941ca7f5064eeca.tar.gz niri-618fa08aa5649e867c24db5ae941ca7f5064eeca.tar.bz2 niri-618fa08aa5649e867c24db5ae941ca7f5064eeca.zip | |
Update Smithay (apply state in post commit)
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] } |
