# Static White Pattern

**URL:** <https://forum.electromage.com/t/static-white-pattern/1155>\
**Category:** Patterns and Code\
**Created:** [April 9, 2021, 1:54am UTC](https://forum.electromage.com/t/static-white-pattern/1155 "2021-04-09T01:54:57Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![jeff](https://forum.electromage.com/user_avatar/forum.electromage.com/jeff/32/3473_2.png) [@jeff](https://forum.electromage.com/u/jeff)\
**Post date:** [April 9, 2021, 2:11am UTC](https://forum.electromage.com/t/static-white-pattern/1155/2 "2021-04-09T02:11:16Z")

</div>

No prob. I’m assuming you’re not looking to be taught how to fish here.

This should get it done for you.

```javascript
var offset = 0 // How far to start from the left
var onCount = 5
var every = 20

export function render(index) {
  on = mod(index - offset, every) < onCount
  hsv(0, 0, on)
}

// You only need this on PB v2
function mod(dividend, divisor) {
  var res = dividend % divisor
  if ((res != 0) && (res > 0) != (divisor > 0)) { //this compares the sign of both
    res += divisor
  }
  return res
}

```

Edit: The guy who asked for a builtin `mod()` (me) forgot to use it correctly 😑 Now it’s fixed in the above, with [Wizard’s mod polyfill](https://forum.electromage.com/t/task-8-serpentine-square/1088/12) for v2 users.

---

_[View the full topic](https://forum.electromage.com/t/static-white-pattern/1155)._
