diff --git a/src/pattern/moving_rainbow.rs b/src/pattern/moving_rainbow.rs index 26af0fa..8e8c54f 100644 --- a/src/pattern/moving_rainbow.rs +++ b/src/pattern/moving_rainbow.rs @@ -41,6 +41,8 @@ impl Pattern for MovingRainbow { // RAINBOW.len() * width let length_factor = u16::try_from(RAINBOW.len()) .or(Err(()))? + .checked_add(self.skip.into()) + .ok_or(())? .saturating_mul(u16::from(self.width)); // The length of the buffer // Always a factor of length_factor