diff --git a/src/display.rs b/src/display.rs index 26fa5c6..b151936 100644 --- a/src/display.rs +++ b/src/display.rs @@ -619,7 +619,7 @@ impl MPDDisplay { w: filename_dimensions.w, h: filename_dimensions.h, }, - Color::from_rgba(0, 0, 0, 160), + Color::from_rgba(0, 0, 0, self.opts.text_bg_opacity), )?; } if !self.opts.disable_show_album { @@ -631,7 +631,7 @@ impl MPDDisplay { w: album_dimensions.w, h: album_dimensions.h, }, - Color::from_rgba(0, 0, 0, 160), + Color::from_rgba(0, 0, 0, self.opts.text_bg_opacity), )?; } if !self.opts.disable_show_artist { @@ -643,7 +643,7 @@ impl MPDDisplay { w: artist_dimensions.w, h: artist_dimensions.h, }, - Color::from_rgba(0, 0, 0, 160), + Color::from_rgba(0, 0, 0, self.opts.text_bg_opacity), )?; } if !self.opts.disable_show_title { @@ -655,7 +655,7 @@ impl MPDDisplay { w: title_dimensions.w, h: title_dimensions.h, }, - Color::from_rgba(0, 0, 0, 160), + Color::from_rgba(0, 0, 0, self.opts.text_bg_opacity), )?; } let mesh: Mesh = mesh_builder @@ -667,7 +667,7 @@ impl MPDDisplay { w: timer_dimensions.w, h: timer_dimensions.h, }, - Color::from_rgba(0, 0, 0, 160), + Color::from_rgba(0, 0, 0, self.opts.text_bg_opacity), )? .build(ctx)?; diff --git a/src/main.rs b/src/main.rs index 9737fa6..51f0201 100644 --- a/src/main.rs +++ b/src/main.rs @@ -49,6 +49,13 @@ pub struct Opt { case_insensitive = true, )] log_level: debug_log::LogLevel, + #[structopt( + short, + long, + help = "sets the opacity of the text background (0-255)", + default_value = "190" + )] + text_bg_opacity: u8, } fn main() -> Result<(), String> {