X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=ShaheenGandhi.pde;h=740883ddbb71b50da56d6b042c46453844a3b21d;hb=c27cb07897f82f0b9f515587855a1473def2a312;hp=5ab568e3d5f9f5af6ef5325118b2767dc7238091;hpb=fd8a39b0d3b2fa2a54b649e5107ff7d82944c9fa;p=SugarCubes.git diff --git a/ShaheenGandhi.pde b/ShaheenGandhi.pde index 5ab568e..740883d 100644 --- a/ShaheenGandhi.pde +++ b/ShaheenGandhi.pde @@ -120,9 +120,11 @@ class HelixPattern extends SCPattern { // the helix. Figure out if the current point is inside that // region. float d = PVector.dist(p, toroidPoint); - boolean inToroid = abs(d) < girth; + boolean inToroid = d < girth; - return color((lx.getBaseHuef() + (360*(phase / TWO_PI)))%360, (inToroid ? 100 : 0), (inToroid ? 100 : 0)); + // Soften edges by fading brightness + float b = constrain(100*(1 - ((d-.5*girth)/(girth*.5))), 0, 100); + return color((lx.getBaseHuef() + (360*(phase / TWO_PI)))%360, (inToroid ? 80 : 0), b); } } @@ -158,6 +160,7 @@ class HelixPattern extends SCPattern { // parameterized t value. select base pairs and // associated colors. lerp between colors for each // base pair to produce a DNA effect. + } void run(int deltaMs) {