diff --git a/src/util/pattern.rs b/src/util/pattern.rs index 636ca90..33af029 100644 --- a/src/util/pattern.rs +++ b/src/util/pattern.rs @@ -40,6 +40,8 @@ struct Value { impl Pattern for Value { fn execute(&self, values: &mut RwLockWriteGuard<'_, [RawColor; crate::LED_SIZE]>, _ticks: u64) { + + for i in 0..crate::LED_SIZE { let mut color: RawColor = (*values)[i]; if self.r.is_some() { @@ -202,6 +204,26 @@ struct Rainbow { } // todo + +// iterate over but pull +// VecDeque::rotate_right() + +//let mut v = (1..6).collect::>(); +//v.rotate_right(1); +//println!("{:?}", v); + +// IF intented vec is the same as current vec +// dupe & rotate current vec +// change value so it is only gathered once per tick, and only for the first pixel +// set new intended vec to rotated vec +// exit IF +// slowly transform current vec to intended vec by a constant fade value +// reply inside execute fn + +struct Ticker { + ticks: u64, +} + pub fn parse_line(v: Vec) -> Result, ParseError> { println!("{:?}", v); v.try_into()