memoscan
← all memos

Memo 0x11caf738…5f244e on Ethereum

indow.$.BkgGradientSpeed=window.$styles[window.$.Style].BkgGradientSpeed,window.$.FixEdge=window.$styles[window.$.Style].FixEdge,window.$.FlowOrientation=window.$styles[window.$.Style].FlowOrientation,window.$.CellsOnTop=window.$styles[window.$.Style].CellsOnTop,window.$.SuperFlow=window.$styles[window.$.Style].SuperFlow,window.$.GradMode=window.$styles[window.$.Style].GradMode,window.$.FadeCellFillFn=window.$styles[window.$.Style].FadeCellFillFn,window.$.FadeCellStrokeFn=window.$styles[window.$.Style].FadeCellStrokeFn,window.$.CellDivideCount=window.$styles[window.$.Style].CellDivideCount,window.$.AreaWeight=window.$styles[window.$.Style].AreaWeight,window.$.AreaCurve=window.$styles[window.$.Style].AreaCurve,window.$.FlowBatches=window.$styles[window.$.Style].FlowBatches,window.$.TwistBkgSize=window.$styles[window.$.Style].TwistBkgSize,window.$.TwistBkgCurve=window.$styles[window.$.Style].TwistBkgCurve,window.$.Travel=window.$styles[window.$.Style].Travel,window.$.TwistBkg=window.$styles[window.$.Style].TwistBkg,window.$.TwistFlow=window.$styles[window.$.Style].TwistFlow,window.$.FlowWarp=window.$styles[window.$.Style].FlowWarp,window.$.BkgWarp=window.$styles[window.$.Style].BkgWarp,window.$.BkgFadeAmt=window.$styles[window.$.Style].BkgFadeAmt,window.$.Vignette=window.$styles[window.$.Style].Vignette,window.$.BkgFadeFn=window.$styles[window.$.Style].BkgFadeFn,window.$.CrayonTheme=window.$styles[window.$.Style].CrayonTheme,window.$.UseBkgCrayons=window.$styles[window.$.Style].UseBkgCrayons,window.$.UseBkgCrayonsMulti=window.$styles[window.$.Style].UseBkgCrayonsMulti,window.$.UseCellBkgCrayons=window.$styles[window.$.Style].UseCellBkgCrayons,window.$.UseCellLineCrayons=window.$styles[window.$.Style].UseCellLineCrayons,window.$.UseFlowCrayons=window.$styles[window.$.Style].UseFlowCrayons,window.$.CellShakeScale=window.$styles[window.$.Style].CellShakeScale,window.$.CellShakeStrength=window.$styles[window.$.Style].CellShakeStrength??null,window.$.BkgShakeScale=window.$styles[window.$.Style].BkgShakeScale,window.$.BkgShakeStrength=window.$styles[window.$.Style].BkgShakeStrength??null,window.$.FlowShakeScale=window.$styles[window.$.Style].FlowShakeScale,window.$.FlowShakeStrength=window.$styles[window.$.Style].FlowShakeStrength??null,window.$.NoiseTypeBkg=window.$styles[window.$.Style].NoiseTypeBkg,window.$.NoiseTypeFlow=window.$styles[window.$.Style].NoiseTypeFlow,window.$.CellHatchThresh=window.$styles[window.$.Style].CellHatchThresh,window.$.ColorBkgThinLineColorThresh=window.$styles[window.$.Style].ColorBkgThinLineColorThresh,window.$.CellThreshDir=window.$styles[window.$.Style].CellThreshDir,window.$.CellLineRender=window.$styles[window.$.Style].CellLineRender,window.$.LineVariance=window.$styles[window.$.Style].LineVariance,window.$.BkgRender=window.$styles[window.$.Style].BkgRender,window.$.CellOptimize=window.$styles[window.$.Style].CellOptimize,window.$.GlobalOffsetFlow=window.$styles[window.$.Style].GlobalOffsetFlow??360*random(),window.$.GlobalOffsetBkg=window.$styles[window.$.Style].GlobalOffsetBkg??360*random(),window.$.GlobalOffsetCell=window.$styles[window.$.Style].GlobalOffsetCell??360*random(),window.$.BaseSize=window.$styles[window.$.Style].BaseSize,window.$.LineThickness=window.$styles[window.$.Style].LineThickness,window.$.Spacing=window.$styles[window.$.Style].Spacing,window.$.BkgColor=color(window.$styles[window.$.Style].BkgColor),window.$.BkgGradient=window.$styles[window.$.Style].BkgGradient,window.$.BkgCellHatchThresh=window.$styles[window.$.Style].BkgCellHatchThresh,window.$.BkgLineRamp=window.$styles[window.$.Style].BkgLineRamp,window.$.ColorBkgThinLine=color(window.$styles[window.$.Style].ColorBkgThinLine),window.$.ColorSweepAlt=color(window.$styles[window.$.Style].ColorSweepAlt),window.$.ColorSweepAccent=color(window.$styles[window.$.Style].ColorSweepAccent),window.$.ColorSweepAccentAlt=color(window.$styles[window.$.Style].ColorSweepAccentAlt),window.$.ColorBkgLineFill=color(window.$styles[window.$.Style].ColorBkgLineFill),window.$.ColorSweep=color(window.$styles[window.$.Style].ColorSweep),window.$.ColorCellLines=color(window.$styles[window.$.Style].ColorCellLines),window.$.ColorCellBkg=color(window.$styles[window.$.Style].ColorCellBkg),window.$.ColorCellOutline=window.$styles[window.$.Style].ColorCellOutline?color(window.$styles[window.$.Style].ColorCellOutline):null,window.$.FlowBatchSize=window.$styles[window.$.Style].FlowBatchSize,window.$.CellRamp=window.$styles[window.$.Style].CellRamp,window.$.CellLineThickness=window.$styles[window.$.Style].CellLineThickness,window.$.CellLineSpacing=window.$styles[window.$.Style].CellLineSpacing,window.$.CellThresh=window.$styles[window.$.Style].CellThresh,window.$.CellHatch=window.$styles[window.$.Style].CellHatch,window.$.CellZoom=window.$styles[window.$.Style].CellZoom,window.$.BkgLineFillThresh=window.$styles[window.$.Style].BkgLineFillThresh,window.$.NoiseScale=window.$styles[window.$.Style].NoiseScale,window.$.NoiseStrength=window.$styles[window.$.Style].NoiseStrength,window.$.GradientBand=window.$styles[window.$.Style].GradientBand,window.$.GradientBandOffset=window.$styles[window.$.Style].GradientBandOffset,window.$.FlowScale=window.$styles[window.$.Style].FlowScale,window.$.FlowStrength=window.$styles[window.$.Style].FlowStrength,window.$.FlowZ=window.$styles[window.$.Style].FlowZ,window.$.FlowCells=window.$styles[window.$.Style].FlowCells,window.$.FlowGradient=window.$styles[window.$.Style].FlowGradient,window.$.FlowGradientFn=window.$styles[window.$.Style].FlowGradientFn,window.$.FlowGradientBand=window.$styles[window.$.Style].FlowGradientBand,window.$.FlowGradientOffset=window.$styles[window.$.Style].FlowGradientOffset,window.$.FlowSpeed=window.$styles[window.$.Style].FlowSpeed,window.$.FlowRender=window.$styles[window.$.Style].FlowRender,window.$.FlowWeight=window.$styles[window.$.Style].FlowWeight,window.$.CellRender=window.$styles[window.$.Style].CellRender,window.$.Pad=window.$styles[window.$.Style].Pad,window.$.PadOuter=random(.15,.75),window.$.BkgColorFlip=!1,window.$.CellHasGradient=window.$styles[window.$.Style].CellHasGradient,window.$.CellGradientStrokeA=window.$styles[window.$.Style].CellGradientStrokeA,window.$.CellGradientStrokeB=window.$styles[window.$.Style].CellGradientStrokeB,window.$.CellGradientFillA=window.$styles[window.$.Style].CellGradientFillA,window.$.CellGradientFillB=window.$styles[window.$.Style].CellGradientFillB,window.$.SweepAccentRatio=window.$styles[window.$.Style].SweepAccentRatio,window.$.DimChance=window.$styles[window.$.Style].DimChance,window.$.DimRange=window.$styles[window.$.Style].DimRange,window.$.CellOutlineWeight=window.$styles[window.$.Style].CellOutlineWeight,window.$.BkgColorFlip&&random()<.5){const e=window.$.BkgColor;window.$.BkgColor=window.$.ColorBkgThinLine,window.$.ColorBkgThinLine=e}return window.$.UseCellBkgCrayons&&(window.$.CellHasGradient=!1),window.$.UseFlowCrayons&&(window.$.ColorSweepAccent=color(0),window.$.ColorSweepAccentAlt=color(0)),window.$})(window.$f),window.windowResized(),colorMode(HSB,360,100,100),frameRate(60)};const se=({reset:e,cells:i,speed:o,scale:n,strength:l,col:t,weight:r,skip:w})=>{e&&re();const s=Array(i*i).fill().map(((e,o)=>[o%i/i+.5/i,~~(o/i)/i+.5/i]));Q(s);const a=te();let d=[];const h="Radial"===window.$.NoiseTypeFlow?N:noise,c=window.$.FlowWarp,g=window.$.FlowZ,$=window.$.FlowShakeStrength,C=window.$.FlowShakeScale,y=window.$.Pad;for(let[e,i]of s){let s=[];const p=~~((1-(.5*i+.25))*window.$.Travel);for(let t=0;t<p;t++){K++;const t=2*e-1,r=2*i-1;let w=h(e/n,i/n*c,K*g+($??h(e/C,i/C,0)*$))*l;if(window.$.TwistFlow&&(w+=J(t,r,1,window.$.TwistFlow,2)),e+=cos(w)*o,i+=sin(w)*o,e<y||i<y||e>1-y||i>1-y)continue;const d=~~(e*a),p=~~(i*a);if(p>I.length-1||d>I[0].length-1||I[p][d])break;let u=!1;for(let e=-1;e<1&&!u;e++)for(let i=-1;i<1&&!u;i++){const o=d+i,n=p+e;n<0||o<0||n>I.length-1||o>I[0].length-1||I[n][o]&&(u=!0)}if(u)break;s.push([e,i])}const u=s.length;for(let e=0;e<u;e++){const[i,o]=s[e],n=~~(i*a);I[~~(o*a)][n]=!0,e===u-1&&d.push(s[e])}if(w&&random()<w)continue;const f=window.$.FlowGradient?color(0):u<p*window.$.SweepAccentRatio?random()<.5?window.$.ColorSweepAlt:window.$.UseFlowCrayons?X(0):window.$.ColorSweep:u<p?random()<.5?window.$.ColorSweepAlt:window.$.UseFlowCrayons?X(0):window.$.ColorSweepAccent:t,S=window.$.FlowGradientBand?random(...window.$.FlowGradientBand):0,k=(random(-window.$.FlowGradientOffset,window.$.FlowGradientOffset)+window.$.GlobalOffsetFlow)%360;ne(s,f,r,S,k)}return d};function ae(e,i,o,n,l,t,r=1,w=!1,s=!1){const a=cos(i),d=sin(i),h=sqrt(width*width+height*height),c=Math.ceil(2*h/(o*width));let g=0;const $=[];for(let i=0;i<=c;i++){const n=i*o*width-h,l=width/2-h*a+n*d,t=height/2-h*d-n*a,r=width/2+h*a+n*d,w=height/2+h*d-n*a;he(l,t,r,w,e)&&($.push({x1:l,y1:t,x2:r,y2:w}),g++)}$.forEach(((i,o)=>{const a=(w?g-1-o:o)/(g-1),d=l+Math.pow(a,r)*t*width;!function(e,i,o,n,l,t,r){const w=l.length;let s=[];for(let t=0,r=w-1;t<w;r=t++){const w=l[t][0],a=l[t][1],d=l[r][0],h=l[r][1],c=ce(e,i,o,n,w,a,d,h);c&&s.push(c)}s.sort(((o,n)=>{const l=e-o[0],t=i-o[1],r=e-n[0],w=i-n[1];return l*l+t*t-(r*r+w*w)}));for(let e=1;e<s.length;e+=2)de(s[e-1][0],s[e-1][1],s[e][0],s[e][1],t,r)}(i.x1,i.y1,i.x2,i.y2,e,s?X():n,d)}))}function de(e,i,o,n,l,t){const r=atan2(n-i,o-e),w=t/2,s=w*sin(r),a=w*cos(r),d=e-s,h=i+a,c=e+s,g=i-a,$=o+s,C=n-a,y=o-s,p=n+a;fill(l),noStroke(),quad(d,h,c,g,$,C,y,p)}function he(e,i,o,n,l){const t=l.length;for(let r=0,w=t-1;r<t;w=r++){const t=l[r][0],s=l[r][1],a=l[w][0],d=l[w][1],h=(e-o)*(s-d)-(i-n)*(t-a);if(0!==h){const l=((e-t)*(s-d)-(i-s)*(t-a))/h,r=((o-t)*(i-s)-(n-s)*(e-t))/h;if(l>=0&&l<=1&&r>=0&&r<=1)return!0}}return!1}function ce(e,i,o,n,l,t,r,w){const s=o-e,a=n-i,d=r-l,h=w-t,c=e-l,g=i-t,$=h*s-d*a;if(0!==$){const o=(d*g-h*c)/$,n=(s*g-a*c)/$;if(o>=0&&o<=1&&n>=0&&n<=1)return[e+o*s,i+o*a]}return null}const ge=()=>{const{NoiseTypeFlow:e,FlowCells:i,FlowSpeed:o,FlowScale:n,FlowStrength:l,ColorSweepAccentAlt:t,FlowWeight:r,FlowZ:w,FlowBatchSize:s,FlowBatches:a,SuperFlow:d}=window.$,h="Radial"===e?N:noise;let c=[];le();const g=se({reset:!0,cells:i,speed:o,scale:n,strength:l,col:t,weight:r,z:0,skip:d?0:1}),$=se({reset:!0,cells:i,speed:o,scale:n,strength:l,col:t,weight:r,z:w*(s*a),skip:d?0:1});Array.prototype.push.apply(c,g),Array.prototype.push.apply(c,$),E=R.from(c);const{CellOptimize:C,CellShakeStrength:y,CellShakeScale:p,Pad:u,FlowOrientation:f}=window.$;if(C||y){for(let e=0;e<c.length;e++){let i=[...E.neighbors(e)],o=0,n=0,l=i.length;for(let e=0;e<l;e++){let t=i[e];o+=c[t][0]/l,n+=c[t][1]/l}if(y){const e=h(o/p,n/p,0)*y,i=random(.1,1);o+=o*Math.sin(e)*i,n+=n*Math.sin(e)*i}c[e][0]=o,c[e][1]=n}c=function(e,i,o,n){let l=1/0,t=1/0,r=-1/0,w=-1/0;for(let i of e)l=Math.min(l,i[0]),t=Math.min(t,i[1]),r=Math.max(r,i[0]),w=Math.max(w,i[1]);const s=1*(1-2*n)/(r-l),a=1*(1-2*n)/(w-t),d=(1-(r-l)*s)/2,h=(1-(w-t)*a)/2;return e.map((([e,i])=>[(e-l)*s+d,(i-t)*a+h]))}(c,0,0,u),f&&(c=function(e,i,o){const n=[.5,.5],l=n[0],t=n[1],r=e=>[l-(e[1]-t),t+(e[0]-l)],w=e=>[2*l-e[0],e[1]],s=[e=>e,w,r,e=>w(r(e)),e=>r(r(e)),e=>w(r(r(e))),e=>r(r(r(e)))][i];return e.map(s)}(c,f))}if(E=R.from(c),V=E.voronoi([0,0,width,height]),window.$.CellRender){const{Pad:e,CellDivideCount:i,CellThreshDir:o,CellThresh:n}=window.$;let l=[];const t=Array.from({length:i||1},((e,i)=>n/2**i));for(let n=0;n<(i||1);n++){const r=t[n];for(let n of V.cellPolygons())if(n){let t=!0;for(let i of n)if(i[0]<=e||i[1]<=e||i[0]>=1-e||i[1]>=1-e){t=!1;break}if(!t)continue;const w=ie(n);if(!window.$.Ghost&&(-1===o&&w>r||-1!==o&&w<r))continue;if(l.push(n),i<2)continue;const s=n.flatMap((e=>[e[0],e[1]])),a=O()(s);for(let e=0;e<a.length;e+=3){const i=[[s[2*a[e]],s[2*a[e]+1]],[s[2*a[e+1]],s[2*a[e+1]+1]],[s[2*a[e+2]],s[2*a[e+2]+1]],[s[2*a[e]],s[2*a[e]+1]]];l.push(i)}}}window.$.FixEdge&&(l=function(e,i,o,n){let l=1/0,t=1/0,r=-1/0,w=-1/0;e.forEach((e=>{e.forEach((e=>{e[0]<l&&(l=e[0]),e[1]<t&&(t=e[1]),e[0]>r&&(r=e[0]),e[1]>w&&(w=e[1])}))}));const s=1*(1-2*n)/(r-l),a=1*(1-2*n)/(w-t),d=(1-(r-l)*s)/2,h=(1-(w-t)*a)/2;return e.map((e=>e.map((([e,i])=>[(e-l)*s+d,(i-t)*a+h]))))}(l,0,0,1-window.$.Pad/2));for(let e of l){let i=e.map((([e,i])=>[e*width,i*height]));if(!window.$.FixEdge){let o=1/0,n=1/0,l=-1/0,t=-1/0;for(let e of c)o=Math.min(o,e[0]),n=Math.min(n,e[1]),l=Math.max(l,e[0]),t=Math.max(t,e[1]);const r=width/(l-o),w=height/(t-n),s=(width-(l-o)*r)/2,a=(height-(t-n)*w)/2;i=e.map((([e,i])=>[(e-o)*r+s,(i-n)*w+a]))}let o=window.$.UseCellBkgCrayons?X():window.$.ColorCellBkg;window.$.ColorCellBkg?fill(color((hue(o)+window.$.GlobalOffsetCell)%360,saturation(o),brightness(o))):noFill();const n=ee(e);let l=window.$.CellHasGradient?lerpColor(color((hue(window.$.CellGradientStrokeA)+window.$.GlobalOffsetCell)%360,saturation(window.$.CellGradientStrokeA),brightness(window.$.CellGradientStrokeA)),color((hue(window.$.CellGradientStrokeB)+window.$.GlobalOffsetCell)%360,saturation(window.$.CellGradientStrokeB),brightness(window.$.CellGradientStrokeB)),we(n,"stroke")):window.$.ColorCellLines;l=window.$.UseCellLineCrayons?X():l,window.$.ColorCellOutline?stroke(color((hue(window.$.ColorCellOutline)+window.$.GlobalOffsetCell)%360,saturation(window.$.ColorCellOutline),brightness(window.$.ColorCellOutline))):noStroke(),window.$.CellHasGradient&&fill(lerpColor(window.$.CellGradientFillA,window.$.CellGradientFillB,we(n,"fill")));const t=ie(e);let r=window.$.CellOutlineWeight*width+(window.$.AreaWeight?t**window.$.AreaCurve*window.$.AreaWeight*width:0);strokeWeight(r),noStroke(),window.$.Ghost&&(window.$.HyperGhost?t>=window.$.CellThresh:t<window.$.CellThresh)&&noFill(),beginShape();for(const e of i)vertex(...e);endShape(),noFill();const w=oe(i),s=h(e[0][0]/window.$.FlowScale,e[0][1]/window.$.FlowScale*window.$.FlowWarp,0)*window.$.FlowStrength,a=Math.cos(s)/2+.5,d=window.$.CellZoom?Math.pow(a,2)*window.$.CellZoom+1:1,g=window.$.CellLineThickness;if(noFill(),window.$.Ghost&&!(window.$.HyperGhost?t<window.$.CellThresh:t>=window.$.CellThresh)||(window.$.CellLineRender&&ae(i,w,window.$.CellLineSpacing*d,l,.001,.001*g,window.$.CellRamp*a,!1,!1),window.$.CellLineRender&&(window.$.CellHatch&&!window.$.CellHatchThresh||window.$.CellHatchThresh&&t>window.$.CellHatchThresh)&&ae(i,w+PI/2,window.$.CellLineSpacing*d,l,.001,.001*g,window.$.CellRamp*a,!1,!1)),window.$.ColorCellOutline){let e=color((hue(window.$.ColorCellOutline)+window.$.GlobalOffsetCell)%360,saturation(window.$.ColorCellOutline),brightness(window.$.ColorCellOutline));window.$.Ghost&&(window.$.HyperGhost?t>=window.$.CellThresh:t<window.$.CellThresh)&&(e=window.$.GhostInvert?100:0,strokeWeight(r*(window.$.GhostWeight||1.125))),noFill(),stroke(e),beginShape();for(const e of i)vertex(...e);endShape()}}}},$e=()=>{if(window.$.FlowRender)for(let e=0;e<window.$.FlowBatchSize/window.$.FlowBatches;e++){let e=random()<.5?window.$.UseFlowCrayons?X(2):window.$.ColorSweep:window.$.ColorSweepAccentAlt;se({reset:!0,cells:window.$.FlowCells,speed:window.$.FlowSpeed,scale:window.$.FlowScale,strength:window.$.FlowStrength,col:color(hue(e),saturation(e)+random(-15,15),brightness(e)+random(-15,15)),weight:window.$.FlowWeight})}};function Ce(e){const i=window.$.Spacing+window.$.LineThickness,o=window.$.BaseSize,n=o*window.$.Pad*window.$.PadOuter,l=o-n,t=i*o,r=Z.query({x:e.x-t,y:e.y-t,width:2*t,height:2*t});if(e.x<n||e.x>l||e.y<n||e.y>l)return!1;for(const i of r)if(dist(e.x,e.y,i.x,i.y)<=t)return!1;return!0}function ye(e,i,o,n){const l="Radial"===window.$.NoiseTypeBkg?N:noise,t=[e];let r=e.copy();const w=window.$.StreamFactor||.1;for(;;){let e=r.x/window.$.BaseSize*2-1,i=r.y/window.$.BaseSize*2-1,o=l(e/window.$.NoiseScale,i/window.$.NoiseScale*window.$.BkgWarp,window.$.BkgShakeStrength?l(e/window.$.BkgShakeScale,i/window.$.BkgShakeScale,0)*window.$.BkgShakeStrength:0)*window.$.NoiseStrength;window.$.TwistBkgCurve&&(o+=J(e,i,window.$.TwistBkgSize,window.$.TwistBkg,window.$.TwistBkgCurve));const n=cos(o),s=sin(o);if(r.add(n*window.$.Spacing*window.$.BaseSize*w,s*window.$.Spacing*window.$.BaseSize*w),!Ce(r)||r.x<0||r.x>window.$.BaseSize||r.y<0||r.y>window.$.BaseSize)break;t.push(r.copy())}const s=360*random();if(!(t.length<2))if(Z.insert({x:e.x,y:e.y}),t.forEach((e=>Z.insert({x:e.x,y:e.y}))),2===window.$.GradMode?t.length<window.$.StreamThresh:1===window.$.GradMode?i<window.$.BkgLineFillThresh:i>=window.$.BkgLineFillThresh){noStroke(),fill(0);const e=function(e,i){const o=[],n=[];return e.forEach(((l,t)=>{let r,w,s,a;const d=e[(t-1+e.length)%e.length],h=e[(t+1)%e.length];if(0===t){const e=Math.atan2(h[1]-l[1],h[0]-l[0]);r=i/2*Math.cos(e+Math.PI/2),w=i/2*Math.sin(e+Math.PI/2),s=i/2*Math.cos(e-Math.PI/2),a=i/2*Math.sin(e-Math.PI/2)}else if(t===e.length-1){const e=Math.atan2(l[1]-d[1],l[0]-d[0]);r=i/2*Math.cos(e+Math.PI/2),w=i/2*Math.sin(e+Math.PI/2),s=i/2*Math.cos(e-Math.PI/2),a=i/2*Math.sin(e-Math.PI/2)}else{const e=(Math.atan2(l[1]-d[1],l[0]-d[0])+Math.atan2(h[1]-l[1],h[0]-l[0]))/2;r=i/2*Math.cos(e+Math.PI/2),w=i/2*Math.sin(e+Math.PI/2),s=i/2*Math.cos(e-Math.PI/2),a=i/2*Math.sin(e-Math.PI/2)}o.push([l[0]+r,l[1]+w]),n.push([l[0]+s,l[1]+a])})),o.concat(n.reverse())}(t.map((({x:e,y:i})=>[e*(width/window.$.BaseSize),i*(height/window.$.BaseSize)])),i*width);ae(e,s,.005,n,.001,.002,window.$.BkgLineRamp,random()<.5,window.$.UseBkgCrayonsMulti),random()<window.$.BkgCellHatchThresh&&ae(e,s+PI/2,.005,n,.001,.002,window.$.BkgLineRamp,random()<.5,window.$.UseBkgCrayonsMulti)}else{const e=i*window.$.BaseSize*(width/window.$.BaseSize);noStroke(),fill(o),strokeWeight(e);const n=random(-window.$.GradientBandOffset,window.$.GradientBandOffset);let l=window.$.BkgGradientSpeed||t.length;t.forEach(((i,o)=>{window.$.BkgGradient&&fill(color((o/l*window.$.GradientBand+n+(window.$.BkgGradientShift??0))%360,100,100)),circle(i.x*(width/window.$.BaseSize),i.y*(height/window.$.BaseSize),e)}))}}window.draw=()=>{let e=0;if(0===q&&window.$.BkgRender)for(;e<1e3;){const i=random(window.$.BaseSize),o=random(window.$.BaseSize),n=createVector(i,o);if(Ce(n)){let e=1;(1===window.$.BkgFadeFn||-1===window.$.BkgFadeFn)&&(e=o/window.$.BaseSize*window.$.BkgFadeAmt+(1-window.$.BkgFadeAmt));let i,l=color(hue(window.$.ColorBkgThinLine),saturation(window.$.ColorBkgThinLine),brightness(window.$.ColorBkgThinLine)*(random()<window.$.DimChance?random(...window.$.DimRange):1)*e);random()>window.$.ColorBkgThinLineColorThresh&&(l=color(hue(l),0,brightness(l)*e)),window.$.UseBkgCrayons&&(i=X(),i=color(hue(i),saturation(i),brightness(i)*e)),ye(n,window.$.LineThickness*("None"===window.$.LineVariance?1:"Random"===window.$.LineVariance?random(.5,1.5):"Alternate"===window.$.LineVariance?random()<.5?.2:1:void 0),window.$.UseBkgCrayons?i:l,window.$.UseBkgCrayons?color(hue(i),saturation(i),brightness(i)*e):color(hue(window.$.ColorBkgLineFill),saturation(window.$.ColorBkgLineFill),brightness(window.$.ColorBkgLineFill)*e)),j=0}else j++;if(e++,j>=150)break}if(q>0||!window.$.BkgRender||j>=150){if(0===q)return q++;if(1===q)return window.$.Vignette&&ue(),q++;if(2===q)return K=0,window.$.CellsOnTop||ge(),q++;if(3===q&&le(),q<window.$.FlowBatches+3){for(let e=0;e<1;e++)K=0,$e(),q++;return}window.$.CellsOnTop&&(K=0,ge()),noLoop(),"saving"===window.renderStatus?(window.renderStatus="complete",saveCanvas("ephemeral_tides","png")):window.renderStatus="complete",q=4}};const pe=(e,i,o)=>((e,i,o,n)=>{const l=Math.min(o/e,n/1);return[e*l,1*l]})(e,0,i,o),ue=()=>{let e=random(.95,.98),i=random(.45,.5),o=random(1,2);const n=pixelDensity();loadPixels();for(let l=0;l<height*n;l++)for(let t=0;t<width*n;t++){const r=4*(t+l*width*n),w=dist(t/n,l/n,width/2,height/2),s=dist(0,0,width/2,height/2),a=pow(w/(s*i),o),d=map(a,0,1,1,e);pixels[r]*=d,pixels[r+1]*=d,pixels[r+2]*=d}updatePixels()},fe=()=>{background(window.$.BkgColor),window.$.Vignette&&ue(),Z=new l(0,0,window.$.BaseSize,window.$.BaseSize,16),le(),q=0,K=0,j=0};window.windowResized=()=>{if("saving"===window.renderStatus)return;le();const[e,i]=pe(1,windowWidth,windowHeight);resizeCanvas(e,i),fe(),loop()};const Se=e=>{if("saving"===window.renderStatus)return;const i=pixelDensity();resizeCanvas(e/i,e/i*1),window.renderStatus="saving",fe(),loop()};window.keyTyped=()=>{switch(key){case"p":Se(12288);break;case"s":Se(2560)}}})()})();