X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=GranimPattern.pde;h=83a70be6eca6e5f05c3892797ecb22cfc4b6de20;hb=dde759833df1c0190d9d3a982a90c0a4f8d76a26;hp=0a34bafe986d1d4baac8eda506158b9cc3a1ef40;hpb=2cbe69543e6783e632c76647586633aa7fe1f76b;p=SugarCubes.git diff --git a/GranimPattern.pde b/GranimPattern.pde index 0a34baf..83a70be 100644 --- a/GranimPattern.pde +++ b/GranimPattern.pde @@ -27,7 +27,7 @@ class Granim extends Graphic { while(width()< g.position+1) { - graphicBuffer.add(color(0,0,0)); + graphicBuffer.add(lx.hsb(0,0,0)); } drawAll(); displayList.put(name , g); @@ -55,7 +55,7 @@ class Granim extends Graphic { while(width()< g.position + g.width()) { - graphicBuffer.add(color(0,0,0)); + graphicBuffer.add(lx.hsb(0,0,0)); } if(g.changed) { @@ -79,9 +79,9 @@ class GranimPattern extends SCPattern { HashMap displayList; - GranimPattern(GLucose glucose) + GranimPattern(LX lx) { - super(glucose); + super(lx); displayList = new HashMap(); } @@ -96,7 +96,7 @@ class GranimPattern extends SCPattern return displayList.get(name); } - public void run(int deltaMs) + public void run(double deltaMs) { drawToPointList(); } @@ -109,7 +109,7 @@ class GranimPattern extends SCPattern { ((Granim) g).update(); } - List drawList = model.points.subList(Math.min(g.position,colors.length-1), Math.min(g.position + g.width(),colors.length-1)); + List drawList = model.points.subList(Math.min(g.position,colors.length-1), Math.min(g.position + g.width(),colors.length-1)); //println("drawlistsize "+drawList.size()); gbuffer = g.graphicBuffer.toArray(new Integer[0]); @@ -118,7 +118,7 @@ class GranimPattern extends SCPattern { colors[drawList.get(i).index] = gbuffer[i]; } - g.changed =false; + g.changed = false; } } @@ -141,7 +141,7 @@ class RedsGraphic extends Graphic { for(int i = 0; i < len ;i++) { - graphicBuffer.add(color(0,255,255)); + graphicBuffer.add(lx.hsb(0,255,255)); } } }; @@ -188,31 +188,35 @@ class RandomsGranim extends Granim _len=len; addGraphic("myrandoms", makeGraphic(len)); } + int colorLid=0; public Graphic makeGraphic(int len) { + int[] colors= new int[len]; for(int i =0;i