Advertisement
sevenfives

Processing / RGB blend experiments

May 28th, 2015
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.85 KB | None | 0 0
  1. float[] x = new float [10];
  2. float[] y = new float [10];
  3. int[] clr = new int [10];
  4. color[] c = new color [3];
  5.  
  6. void setup () {
  7.   size(400, 400, P2D);
  8.   background(0);
  9.   noStroke();
  10.   ellipse(width/2, height/2, 180, 180);
  11.  
  12.   for (int i = 0; i < x.length; i++) {
  13.   c[0] = color(255, 0, 0);
  14.   c[1] = color(0, 255, 0);
  15.   c[2] = color(0, 0, 255);
  16.  
  17.   x[i] = random(1, 50);
  18.   y[i] = random(60, 100);
  19.   clr[i] = c[int(random(3))];
  20.   }
  21.  
  22.    
  23. }
  24.  
  25. void draw() {
  26.   blendMode(BLEND);
  27.   fill(255, 10);
  28.   ellipse(width/2, height/2, 180, 180);
  29.   blendMode(SUBTRACT);
  30.  
  31.         for(int i = 0; i < x.length; i++) {
  32.             fill(clr[i]);
  33.             ellipse(width/2+cos(x[i])*70, height/2+sin(y[i])*70, 160, 160);
  34.             x[i] = x[i] + 0.02;
  35.             y[i] = y[i] + 0.04;
  36.           }
  37.          
  38.  //saveFrame("cirlce_blend-######.png");
  39.  
  40.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement