luana releitura ianelli - fabrica-escola/artes-2o-ano-carmem-silva GitHub Wiki

vermelho = color(200, 0, 0)
roxo = color(20, 0, 60)

def setup():
    size(700, 500)
    background(5, 4, 80)
    
    for n in range(200000):
        x = random(0, 300)
        y = random(0, 500)
        taxa = map(x, 0, 300, 0, 1)  #x / 300
        cor = lerpColor(vermelho, roxo, taxa)
        stroke(cor)
        point(x, y)
        
    for n in range(200000):
        x = random(400, 700)
        y = random(0, 500)
        taxa = map(x, 400, 700, 0, 1)   #(x - 400) / 300
        cor = lerpColor(roxo, vermelho, taxa)
        stroke(cor)
        point(x, y)

image