intermediate changes

This commit is contained in:
jane 2023-02-27 16:47:16 -05:00
parent 48dee090d3
commit 37ffa707eb

View file

@ -40,6 +40,8 @@ struct Value {
impl Pattern for Value { impl Pattern for Value {
fn execute(&self, values: &mut RwLockWriteGuard<'_, [RawColor; crate::LED_SIZE]>, _ticks: u64) { fn execute(&self, values: &mut RwLockWriteGuard<'_, [RawColor; crate::LED_SIZE]>, _ticks: u64) {
for i in 0..crate::LED_SIZE { for i in 0..crate::LED_SIZE {
let mut color: RawColor = (*values)[i]; let mut color: RawColor = (*values)[i];
if self.r.is_some() { if self.r.is_some() {
@ -202,6 +204,26 @@ struct Rainbow {
} }
// todo // todo
// iterate over but pull
// VecDeque::rotate_right()
//let mut v = (1..6).collect::<VecDeque<_>>();
//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<String>) -> Result<Box<dyn Pattern>, ParseError> { pub fn parse_line(v: Vec<String>) -> Result<Box<dyn Pattern>, ParseError> {
println!("{:?}", v); println!("{:?}", v);
v.try_into() v.try_into()