# colorNoise.py
from Processing import *

window(500, 300)
background(0)

# Delay all screen updates
# until redraw is called
immediateMode(False)

def makeNoise():
    background(0)

    loadPixels()
    for i in range(5000):
        x = int(random(500))
        y = int(random(300))
        r = random(255)
        g = random(255)
        b = random(255)
        c = color(r, g, b)
        setPixel(x, y, c)
    updatePixels()

    # Render current sketch window
    redraw()
    #delay(500)

# Generate 1000 frames of random noise
for i in range(100):
    makeNoise()
