switched from data to css output

This commit is contained in:
Nickiel12 2023-11-09 15:51:17 -08:00
parent d56a670145
commit e40bfb1a06

View file

@ -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<i32> { fn parse_time(i: &str) -> Option<i32> {