From e40bfb1a06ae1279b193b5bb4e4ac509af0c3ed8 Mon Sep 17 00:00:00 2001 From: Nickiel12 Date: Thu, 9 Nov 2023 15:51:17 -0800 Subject: [PATCH] switched from data to css output --- ewwtilities/src/calendar_background.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ewwtilities/src/calendar_background.rs b/ewwtilities/src/calendar_background.rs index 6628294..1f95072 100644 --- a/ewwtilities/src/calendar_background.rs +++ b/ewwtilities/src/calendar_background.rs @@ -142,7 +142,20 @@ pub fn run_calendar(args: &CliArgs) { } } - println!("{}", serde_json::to_string(&output_state).unwrap()); + + if !output_state.has_bg { + println!("rgba(0, 0, 0, 0.0)"); + } else { + let gradient_color = if output_state.is_sun { + "#ffa500" + } else { + "#d3d3d3" + }; + + println!("linear-gradient({}deg, {}, #262626)", (output_state.gradient_angle_percentage * 180.0 - 90.0) as u32, gradient_color); + } + + // println!("{}", serde_json::to_string(&output_state).unwrap()); } fn parse_time(i: &str) -> Option {