X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=ArjunBanker.pde;h=4709bdcfe9c86ba16974ce1f9712ec8e1d479550;hb=344908672b7cfe1efba03f739ef945601dae1b8e;hp=6af635a6286bcb7b755606dbd36ada5176dd00ba;hpb=34327c962351112e07c3d93f56ffc543fac45b58;p=SugarCubes.git diff --git a/ArjunBanker.pde b/ArjunBanker.pde index 6af635a..4709bdc 100644 --- a/ArjunBanker.pde +++ b/ArjunBanker.pde @@ -15,8 +15,8 @@ class TelevisionStatic extends SCPattern { void run(double deltaMs) { boolean d = direction.getValuef() > 5.0; - for (Point p : model.points) { - colors[p.index] = color((lx.getBaseHuef() + random(hueParameter.getValuef() * 360))%360, random(saturationParameter.getValuef() * 100), random(brightParameter.getValuef() * 100)); + for (LXPoint p : model.points) { + colors[p.index] = lx.hsb((lx.getBaseHuef() + random(hueParameter.getValuef() * 360))%360, random(saturationParameter.getValuef() * 100), random(brightParameter.getValuef() * 100)); } } } @@ -38,9 +38,9 @@ class AbstractPainting extends SCPattern { } void run(double deltaMs) { - for (Point p : model.points) { + for (LXPoint p : model.points) { color c = img.get((int)((p.x / model.xMax) * img.width), img.height - (int)((p.y / model.yMax) * img.height)); - colors[p.index] = color(hue(c) + colorMod.getValuef()%360, saturation(c), brightness(c) - ((p.fz - brightMod.getValuef())/p.fz)); + colors[p.index] = lx.hsb(hue(c) + colorMod.getValuef()%360, saturation(c), brightness(c) - ((p.z - brightMod.getValuef())/p.z)); } } } @@ -55,8 +55,8 @@ class Spirality extends SCPattern { Spirality(GLucose glucose) { super(glucose); addParameter(r); - for (Point p : model.points) { - colors[p.index] = color(0, 0, 0); + for (LXPoint p : model.points) { + colors[p.index] = lx.hsb(0, 0, 0); } } @@ -65,17 +65,17 @@ class Spirality extends SCPattern { rad += deltaMs * .025 * direction; float x = model.xMax / 2 + cos(angle) * rad; float y = model.yMax / 2 + sin(angle) * rad; - for (Point p : model.points) { - float b = dist(x,y,p.fx,p.fy); + for (LXPoint p : model.points) { + float b = dist(x,y,p.x,p.y); if (b < 90) { colors[p.index] = blendColor( colors[p.index], - color(lx.getBaseHuef() + 25, 10, map(b, 0, 10, 100, 0)), + lx.hsb(lx.getBaseHuef() + 25, 10, map(b, 0, 10, 100, 0)), ADD); } else { colors[p.index] = blendColor( colors[p.index], - color(25, 10, map(b, 0, 10, 0, 15)), + lx.hsb(25, 10, map(b, 0, 10, 0, 15)), SUBTRACT); } }