diff options
| -rw-r--r-- | niri-config/src/appearance.rs | 6 | ||||
| -rw-r--r-- | src/layout/focus_ring.rs | 2 | ||||
| -rw-r--r-- | src/layout/workspace.rs | 12 |
3 files changed, 11 insertions, 9 deletions
diff --git a/niri-config/src/appearance.rs b/niri-config/src/appearance.rs index eba265b0..bf600feb 100644 --- a/niri-config/src/appearance.rs +++ b/niri-config/src/appearance.rs @@ -77,6 +77,12 @@ impl MulAssign<f32> for Color { } } +impl From<Color> for Color32F { + fn from(value: Color) -> Self { + Color32F::from(value.to_array_premul()) + } +} + #[derive(knuffel::Decode, Debug, Clone, Copy, PartialEq)] pub struct Gradient { #[knuffel(property, str)] diff --git a/src/layout/focus_ring.rs b/src/layout/focus_ring.rs index 89fd058b..ed3bd028 100644 --- a/src/layout/focus_ring.rs +++ b/src/layout/focus_ring.rs @@ -77,7 +77,7 @@ impl FocusRing { }; for buf in &mut self.buffers { - buf.set_color(color.to_array_premul()); + buf.set_color(color); } let radius = radius.fit_to(self.full_size.w as f32, self.full_size.h as f32); diff --git a/src/layout/workspace.rs b/src/layout/workspace.rs index ee57db6a..f6f2bab4 100644 --- a/src/layout/workspace.rs +++ b/src/layout/workspace.rs @@ -252,8 +252,6 @@ impl<W: LayoutElement> Workspace<W> { let shadow_config = compute_workspace_shadow_config(options.overview.workspace_shadow, view_size); - let background_color = options.layout.background_color.to_array_unpremul(); - Self { scrolling, floating, @@ -264,7 +262,7 @@ impl<W: LayoutElement> Workspace<W> { view_size, working_area, shadow: Shadow::new(shadow_config), - background_buffer: SolidColorBuffer::new(view_size, background_color), + background_buffer: SolidColorBuffer::new(view_size, options.layout.background_color), output: Some(output), clock, base_options, @@ -318,8 +316,6 @@ impl<W: LayoutElement> Workspace<W> { let shadow_config = compute_workspace_shadow_config(options.overview.workspace_shadow, view_size); - let background_color = options.layout.background_color.to_array_unpremul(); - Self { scrolling, floating, @@ -331,7 +327,7 @@ impl<W: LayoutElement> Workspace<W> { view_size, working_area, shadow: Shadow::new(shadow_config), - background_buffer: SolidColorBuffer::new(view_size, background_color), + background_buffer: SolidColorBuffer::new(view_size, options.layout.background_color), clock, base_options, options, @@ -421,8 +417,8 @@ impl<W: LayoutElement> Workspace<W> { compute_workspace_shadow_config(options.overview.workspace_shadow, self.view_size); self.shadow.update_config(shadow_config); - let background_color = options.layout.background_color.to_array_unpremul(); - self.background_buffer.set_color(background_color); + self.background_buffer + .set_color(options.layout.background_color); self.base_options = base_options; self.options = options; |
