+ }
+
+ class Sweep extends LXLayer {
+
+ final LinearEnvelope position = new LinearEnvelope(0, 1, 1000);
+ float bright = 100;
+ float falloff = 10;
+
+ Sweep() {
+ addModulator(position);
+ }
+
+ public void run(double deltaMs, color[] colors) {
+ if (!position.isRunning()) {
+ return;
+ }
+ float posf = position.getValuef();
+ for (Point p : model.points) {
+ colors[p.index] = blendColor(colors[p.index], color(
+ (lx.getBaseHuef() + .2*abs(p.x - model.cx) + .2*abs(p.y - model.cy)) % 360,
+ 100,
+ max(0, bright - posf*100 - falloff*abs(p.y - posf*model.yMax))
+ ), ADD);
+ }
+ }