From: Mark Slee Date: Fri, 8 Nov 2013 22:22:09 +0000 (-0800) Subject: Fix up to lx.hsb X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=67847b063620910be4ee68874f007a732446461c;p=SugarCubes.git Fix up to lx.hsb --- diff --git a/MarkSlee.pde b/MarkSlee.pde index bcd5c62..59798c5 100644 --- a/MarkSlee.pde +++ b/MarkSlee.pde @@ -57,10 +57,10 @@ class Cathedrals extends SCPattern { if (abs(p.x - cx) < arm) { d = min(abs(p.x - cx), abs(p.y - middle)); } - colors[p.index] = color( + colors[p.index] = lx.hsb( (lx.getBaseHuef() + .2*abs(p.y - model.cy)) % 360, min(100, sf*dist(abs(p.x - cx), p.y, arm, middle)), - max(0, 120 - d*falloff)); + constrain(120 - d*falloff, 0, 100)); } } } @@ -110,7 +110,7 @@ class MidiMusic extends SCPattern { } float posf = position.getValuef(); for (Point p : model.points) { - colors[p.index] = blendColor(colors[p.index], color( + colors[p.index] = blendColor(colors[p.index], lx.hsb( (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)) @@ -255,7 +255,7 @@ class MidiMusic extends SCPattern { for (Point p : s.points) { int wavi = (int) constrain(p.x / model.xMax * wval.length, 0, wval.length-1); float wavb = max(0, wave.getValuef()*100. - 8.*abs(p.y - wval[wavi])); - colors[p.index] = color( + colors[p.index] = lx.hsb( (lx.getBaseHuef() + .2*abs(p.x - model.cx) + .2*abs(p.y - model.cy)) % 360, 100, constrain(wavb + max(0, maxBright - 40.*abs(sparklePos - abs(i - (Cube.POINTS_PER_STRIP-1)/2.))), 0, 100)