class DRAWGENERATIVE extends Shader { // choose channel int channel = HUE; // run, after 30 iterations result will be saved automatically // or press SPACE // channels to work with final static int RED = 0; final static int GREEN = 1; final static int BLUE = 2; final static int HUE = 3; final static int SATURATION = 4; final static int BRIGHTNESS = 5; final static int NRED = 6; final static int NGREEN = 7; final static int NBLUE = 8; final static int NHUE = 9; final static int NSATURATION = 10; final static int NBRIGHTNESS = 11; int n=2000; float [] cx=new float[n]; float [] cy=new float[n]; int len; // working buffer PGraphics buffer; int tick = 0; DRAWGENERATIVE() { name = "fxDrawGenerative"; buffer = createGraphics(renderer.width, renderer.height); buffer.noFill(); buffer.beginDraw(); buffer.strokeWeight(0.3); //buffer.background(0); //ENABLE THIS TO DRAW FROM BLANK buffer.endDraw(); rw = renderer.width; len = (renderer.widthlen) { frameCount=0; println("iteration: " + tick++); for (int i=0; i5?channel-6:channel; float cc; switch(ch) { case RED: cc = red(c); break; case GREEN: cc = green(c); break; case BLUE: cc = blue(c); break; case HUE: cc = hue(c); break; case SATURATION: cc = saturation(c); break; default: cc= brightness(c); break; } return channel>5?255-cc:cc; } }