/** ** ** futureCalligraphy by Joseph Gray - March 2nd 2009 ** ** built using Processing - http://processing.org ** ** */ float distance = 0; float px = 0, py = 0; int rand = 0, prevRand = 0, randDistance = 10; void setup() { size(300, 600); frameRate(30); cursor(CROSS); smooth(); } void draw() { if (focused) { blend(0, 0, width, height, 0, 0, width, height, OVERLAY); fill(222, 55, 11, 4); noStroke(); rect(0, 0, width, height); // randDistance = abs(prevRand-rand); rand = round(random(randDistance+50)); distance = abs(pmouseX-mouseX)*.5; stroke(10, 111, 255-distance+rand, 255); strokeWeight(distance*2+rand); line(pmouseX, pmouseY, mouseX, mouseY); prevRand = rand; filter(ERODE); if (mousePressed) { filter(INVERT); } } }