int blocks=1; int multiplier=4; float [] radii; void setup() { size(150,150); colorMode(HSB, 255); background(255); //func(0,0,width,height); radii = new float[width*height]; for (int y=0;y1.0f) dist=1.0f; radii[x+(y*width)]=dist*dist; } } cursor(CROSS); } void keyPressed() { if (key=='2') multiplier=2; if (key=='3') multiplier=3; if (key=='4') multiplier=4; } void loop() { // func(0,0,width,height); //func((int)(random(1.0f)*width),(int)(random(1.0f)*width),30,30); background(255);//255); int sections=1,sectionSize; float mox,moy; for (sections=1;sections<12;sections*=multiplier) { sectionSize=width/sections; mox = (float)(mouseX-(width/2))/10.0f; moy = (float)(mouseY-(height/2))/10.0f; for (int y=0;y1.0f) dist=1.0f; dist = radii[(xx*m)+(width*(yy*m))]; sourceColour = get(x+xx,y+yy); sourceBrightness = brightness(sourceColour); //sourceBrightness = hue(sourceColour); destBrightness = ((dist)*sourceBrightness)+((1.0f-dist)*(255.0f-sourceBrightness)); destColour = color(0,0,destBrightness); //destColour = color(destBrightness,255,255); set(x+xx,y+yy,destColour); } } }