From 3a81585d51b4abb0b1800bdedff800d2119191a0 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 11 Oct 2021 00:11:27 +0100 Subject: [PATCH] Handle rainbow with splitting in ui --- src/ui.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ui.rs b/src/ui.rs index e40e859..f407966 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -68,19 +68,19 @@ fn parse_cmd(strip_tx: &Sender, s: &str) -> Result<(), String> { let color = parse_color(c, c, c)?; change_pattern(strip_tx, Box::new(pattern::Solid::new(&pattern::SolidParams {color}))) }, - ["r"] => change_pattern(strip_tx, Box::new(pattern::MovingRainbow::new(&pattern::MovingRainbowParams {width: 4, forward: true, skip: 0}))), + ["r"] => change_pattern(strip_tx, Box::new(pattern::MovingRainbow::new(&pattern::MovingRainbowParams {width: 4, forward: true, skip: 0, fromcenter: false}))), ["r", w] => { let width = w.parse::().map_err(|_| String::from("Width could not be parsed"))?; - change_pattern(strip_tx, Box::new(pattern::MovingRainbow::new(&pattern::MovingRainbowParams {width, forward: true, skip: 0}))) + change_pattern(strip_tx, Box::new(pattern::MovingRainbow::new(&pattern::MovingRainbowParams {width, forward: true, skip: 0, fromcenter: false}))) }, ["r", w, f] => { let width = w.parse::().map_err(|_| String::from("Width could not be parsed"))?; - change_pattern(strip_tx, Box::new(pattern::MovingRainbow::new(&pattern::MovingRainbowParams {width, forward: ["t", "T"].contains(f), skip: 0}))) + change_pattern(strip_tx, Box::new(pattern::MovingRainbow::new(&pattern::MovingRainbowParams {width, forward: ["t", "T"].contains(f), skip: 0, fromcenter: false}))) }, ["r", w, f, s] => { let width = w.parse::().map_err(|_| String::from("Width could not be parsed"))?; let skip = s.parse::().map_err(|_| String::from("Skip could not be parsed"))?; - change_pattern(strip_tx, Box::new(pattern::MovingRainbow::new(&pattern::MovingRainbowParams {width, forward: ["t", "T"].contains(f), skip}))) + change_pattern(strip_tx, Box::new(pattern::MovingRainbow::new(&pattern::MovingRainbowParams {width, forward: ["t", "T"].contains(f), skip, fromcenter: false}))) }, ["b", r1, g1, b1, r2, g2, b2, r3, g3, b3] => { let left_color = parse_color(r1, g1, b1)?;