Hello Modulo
Nat Sarkissian · 2023
My intention with this piece was to create something that looked simultaneously human and computerized. The human element is the hand drawn style. The movement of the strokes, the variance of the density of the simulated particles of color, and inaccuracy of the grid are a few of the things I worked with to make this feel as though a human drew it. The computerized element is the complexity and intricacy of the patterns. As each grid cell is created, its color is determined by taking the index of the cell, which has various definitions in this code, modulo some other number. Modulo is not a difficult operator to understand (it simply returns the remainder of a division), but it is not typically taught amongst the four basic operators, addition, subtraction, multiplication, and division. Because of that, it's typically not intuitive. As I developed this work, it felt oddly like building a relationship with modulo. It kept surprising me with complex and unpredictable patterns. I introduced it to more familiar concepts like noise, and trigonometric functions, and continued to see new patterns. My hope is that you will see a little bit of modulo's personality in this work, and consider getting to know this awkward fifth wheel of the arithmetic operators. Nat Sarkissian
How it works
sketch.js advances ribbon strips along a noise-steered direction field (angNs = noise(...)), colors them by modulo arithmetic, and renders each SketchyQuad as a wobbling pen scattering dots in a hand-plotted hatch style.
The core is a flow field that "runs ribbon-like bands along a direction field steered by noise". sketch.js rotates the heading of each step according to the angle obtained from angNs = noise(…), and extends the strip along the flow. Because the noise gives a smooth direction field, flowing striations arise on the screen. The colouring is determined by modulo arithmetic. Because it wraps the index by a modulus, as in (_i·nShapes+_j) % modAmt, to assign colours, a periodic rhythm of colour rides on the bands. Each SketchyQuad wobbles in a hand-drawn manner and scatters points to make a coarse shading like a plotter's hatching. The value of the modulus, the scale of the noise, the number of bands and the colouring change per token, so the range of appearance broadens from regular stripes to organically undulating bundles.
Palette
#f0f8ff#faebd7#00ffff#7fffd4#f0ffff#f5f5dc#ffe4c4#000000#ffebcd#0000ff#8a2be2#a52a2a#deb887#5f9ea0#7fff00#d2691e#ff7f50#6495ed#fff8dc#dc143c#00008b#008b8b#b8860b#a9a9a9#006400#bdb76b#8b008b#556b2f#ff8c00#9932cc#8b0000#e9967a +138 more #dfd8ce#e7bd88#e9a565#e97c67#bcae86#cdb787#deccbb#b6ae9a Algorithms
- Flow Field / Vector Field primary · classification: LLM
- Plotter-style Hatching · classification: LLM
- Perlin / Simplex Noise · classification: LLM
Details
Sources
- IPFS 1p.infura-ipfs.io ↗
- Source verse.works ↗
Related works (by shared algorithms)
Last updated 2026-07-16