an interactive grid

Jinsook Lee
Data Mining the City
1 min readSep 23, 2018

the color change of a grid according to the move of a mouse

#this is where your code should go
x = 10
y = 10
squareSize = 50
spacing = 2
pos = 0
def setup():
size(1060,1060)
def setup():
frameRate(4)

def draw():
background(204)
global pos
pos += .5
for column in xrange(0, 20):
for row in xrange(0, 20):
pushMatrix()
translate(0,0)
popMatrix()
fill(mouseX, mouseY, 0)
strokeWeight((mouseX+mouseY)/50)
rect(x + column * (squareSize + spacing),
y + row * (squareSize + spacing),
squareSize,
squareSize)

--

--