memoscan
← all memos

Memo 0x1ca81a45…135ed8 on Ethereum

,[320,29,39]]},.04],[{name:"Wintry",c:[360,18,97],bg:[224,37,76],bgA:[.5,1],fg:[[0,0,17],[33,88,71],[226,12,56]]},.04],[{name:"Riverside",c:[240,2,95],bg:[214,53,83],bgA:[.5,.75],fg:[[58,24,59],[136,21,44],[239,22,60]]},.04],[{name:"Shore",c:[198,32,94],bg:[198,26,76],bgA:[.75,1],fg:[[187,55,71],[198,100,41],[208,97,18]]},.04],[{name:"Sideshow",c:[260,20,36],bg:[260,20,18],bgA:[.5,1],fg:[[38,89,55],[253,43,71],[344,100,88]]},.04],[{name:"Dark Horse",c:[215,17,26],bg:[215,38,16],bgA:[.5,1],fg:[[5,16,46],[37,77,49],[204,21,75]]},.04],[{name:"Forest Path",c:[186,100,8],bg:[186,10,34],bgA:[.5,.75],fg:[[1,100,69],[315,100,59],[282,86,85]]},.04],[{name:"Lighthouse",c:[203,56,8],bg:[236,100,65],bgA:[.5,1],fg:[[172,90,55],[293,55,68]]},.04]],u=[{name:"Hazy",xDis:1.5,yDis:8,xDen:360,yDen:200,eYDis:1,aDRP:1,xDisp:()=>0,bAI:1,probability:.1,lRC:5,bLRC:5},{name:"Flowing",xDis:4,yDis:1,xDen:400,yDen:300,eYDis:0,aDRP:2,xDisp:(t,e,n)=>e?0:n*Math.sin(t/90)*t/450,bAI:0,probability:.2,lRC:4},{name:"Grainy",xDis:4,yDis:1,xDen:400,yDen:300,eYDis:0,aDRP:1,xDisp:(t,n,a)=>n?0:a*o([4,2,1,-1])*Math.sin(50*e()/25)*t/2e3,bAI:0,probability:.4},{name:"Dense",xDis:1,yDis:1,xDen:30,yDen:8e3,eYDis:0,aDRP:2,xDisp:()=>0,bAI:1,probability:.2},{name:"Sparse",xDis:.5,yDis:1,xDen:75,yDen:1e3,eYDis:0,aDRP:1,xDisp:()=>0,bAI:1,lRC:5,probability:.1,disallowedColorTypes:["Point"]}];function m(t,e,n,o,a,s,r){const l=[a-t,s-e],i=[n-t,o-e],f=h(i,i);let u=h(l,i)/f;u=u<0?0:u,u=u>1?1:u;const m=[i[0]*u+t-a,i[1]*u+e-s];return h(m,m)<=r*r}function h(t,e){return t[0]*e[0]+t[1]*e[1]}function d(t,e,n,o,a,s,r,l){const i=n-t,f=o-e,u=r-a,m=l-s,h=(-f*(t-a)+i*(e-s))/(-u*f+i*m),d=(u*(e-s)-m*(t-a))/(-u*f+i*m);return h>=0&&h<=1&&d>=0&&d<=1}function c(t,e,n,o){if("None"===n.type)return!1;if(["Full","Glowing","Radiant","Blazing"].includes(n.type)){const a=Math.sqrt((t-n.center.x*p)**2+(e-n.center.y)**2);if(!o)return!1;if(a<=n.radius)return!0;for(let t=1;t<=n.haloCount;t++){const e=.05-(t-1)*(.05/n.haloCount);if(a>=n.radius*(1+.2*t-e/2)&&a<=n.radius*(1+.2*t+e/2))return!0}return!1}const a=Math.sqrt((t-n.center.x*p)**2+(e-n.center.y)**2),s=n.radius*{Crescent:1.25,Eclipse:1.01}[n.type],r=2*Math.PI*20/360,l=n.center.x*p+(n.isInverted?-1:1)*Math.sqrt(s**2-n.radius**2)*Math.cos(r),i=n.center.y-Math.sqrt(s**2-n.radius**2)*Math.sin(r),f=Math.sqrt((t-l)**2+(e-i)**2);return!!o&&(a<=n.radius&&f>s||a<=n.radius&&a>=.9833333333333333*n.radius)}const g=16/9,y=g,b=1,p=1.8454106280193234,x=.04,M=3946,D=a(f),P=a(f.filter((([t])=>t.name!==D.name))),A=a([["Layer",.5],["Point",.2],["Linear Gradient",.15],["Reflected Gradient",.15]]),G=a(u.filter((t=>!(t.disallowedColorTypes??[]).includes(A))).map((({name:t,probability:e})=>[t,e]))),w=u.find((t=>t.name===G)),k=["Sparse"].includes(w.name)?"Panorama":a([["Panorama",.75],["Diptych",.05],["Left Break",.05],["Right Break",.05],["Triptych",.05],["Wide Triptych",.05]]);D.bg[3]=D.bgA[w.bAI],P.bg[3]=P.bgA[w.bAI];const R=o(i.filter((t=>!(t.disallowedTechniques??[]).includes(w.name))));"Peaks"===R.name&&"Flowing"===w.name&&(w.lRC=7),"Peaks"===R.name&&"Grainy"===w.name&&(w.lRC=5);const B=R.getLayers(e,o,((t,n)=>{var o,a,s,i;if(l)o=r,l=!1;else{do{i=(a=e()-1)*a+(s=e()-1)*s}while(i>=1);o=a*(i=Math.sqrt(-2*Math.log(i)/i)),r=s*i,l=!0}return o*(n||1)+(t||0)}),n),C=.1678,S=a([[0,.8],[.25,.1],[.5,.1]]),I=e()<.5?1:-1,v=a(R.yOffsets),L=function(t,e,n,o,a,s){const r="Hazy"===t?0:1-n.lumProb,l=s([["None",r],["Full",.35*(1-r)],["Crescent",.2*(1-r)],["Eclipse",.1*(1-r)],["Glowing",.1*(1-r)],["Radiant",.2*(1-r)],["Blazing",.05*(1-r)]]);if("None"===l)return{type:l};const i=Math.max(...e.map((t=>t.tG.map((t=>t.y)))).flat()),f={Glowing:3,Radiant:5,Blazing:10}[l]??0;let u,h,c,g=0;t:for(;++g<100;){const t=["Full","Glowing","Radiant","Blazing"].includes(l);c=a(t?[.1,.2,.3]:[.1,.2]),h=t?o()*i:c/1+.3*o()*(1-2*c/1),u=t?o():c/p+o()*(1-2*c/p);for(const o of e)for(let e=0;e<o.tG.length-1;e++){const{x:a,y:s}=o.tG[e],{x:r,y:l}=o.tG[e+1];if(m(a*p,1*(s+n.offset),r*p,1*(l+n.offset),u*p,1*(h-c*(t?.4:0)),c))continue t;if(a<=u&&r>=u&&!d(a*p,1*(s+n.offset),r*p,1*(l+n.offset),u*p,1*h,u*p,2))continue t}break}return 100===g?{type:"None"}:{type:l,radius:c,center:{x:u,y:h},haloCount:f,isInverted:o()<.5}}(w.name,B,v,e,o,a);let H=parseInt(new URLSearchParams(window.location.search).get("size")??0,10)||Math.min(window.innerWidth/g,window.innerHeight);const z=()=>H,q={Panorama:[],Diptych:[.5],"Left Break":[1/3],"Right Break":[2/3],Triptych:[1/3,2/3],"Wide Triptych":[.2,.8]};function O(t,e){if(t<0||t>p||e<0||e>1)return!0}const E=()=>{const t={td:1,tm:0,dd:1,dm:0,layerHeight:.7,isBackground:!0};return[{tG:[{x:0,y:0},{x:1,y:0}],...t},{tG:[{x:0,y:0},{x:1,y:0}],...t,isInverted:!0}]};new p5((t=>{let a,r,l,i,f,u,m,h,d;const g=[];let G,F;function T(){a=!0,r=1,l=!1,i=!0,t.frameRate(60)}function Y(t){const n=e()<.5;if(1===t.fg.length)return null==t.l?[t.fg[0],t.fg[0]]:n?[t.fg[0],t.l]:[t.l,t.fg[0]];let a,s;for(;!a||!s;)a=o(t.fg),s=o(t.fg.filter((t=>t.join(",")!==a.join(","))).filter((t=>(n?t[0]-a[0]:a[0]-t[0])<180)));return[n?a:s,n?s:a]}function N(t,e,n){let[o,a,s,r]=t,[l,i,f,u]=e;Math.abs(o-l)>180&&(o<l?o+=360:l+=360);const m=[(o+n*(l-o))%360,a+n*(i-a),s+n*(f-s)];return null==r&&null==u||m.push((r??1)+n*((u??1)-(r??1))),m}function W(t,e,n){let[o,a,s,r]=t,[l,i,f,u]=e;Math.abs(o-l)>180&&(o<l?o+=360:l+=360);const m=[(o*(2*n-1)**2+l*(1-(2*n-1)**2))%360,a*(2*n-1)**2+i*(1-(2*n-1)**2),s*(2*n-1)**2+f*(1-(2*n-1)**2)];return null==r&&null==u||m.push((r??1)*(2*n-1)**2+(u??1)*(1-(2*n-1)**2)),m}function j(t,e,n){if(e.noStroke(),!n&&!a&&!l)return void e.noLoop();if(n||e.loop(),!n&&l){if(f<0)return void(-30===f?(i=!0,f=0):f--);if(f>u-1)return void(f===u-1+30?(i=!1,f=u-1):f++)}let o,s,d,c;(n||a&&1===r)&&e.background(...D.c);for(let u=0;u<h.length;u++)for(let g=0;g<h[0].length;g++)if(n||a&&h[u][g]===r-1||l&&m[u][g]===f){o=Math.round((x+(y-2*x)*u/(p/C))*t()),d=Math.round((x+(b-2*x)*g/(1/C))*t()),s=Math.round((x+(y-2*x)*(u+1)/(p/C))*t()),c=Math.round((x+(b-2*x)*(g+1)/(1/C))*t());const r=n&&m[u][g]<f||a&&m[u][g]<f||l&&m[u][g]===f&&i;e.fill(...r?P.c:D.c),e.rectMode(e.CORNERS),e.rect(o,d,s,c)}for(const r of g)for(const u of r.columnLayers)for(let h=0;h<u.length;h++)for(let g=0;g<u[h].length&&!("Flowing"===w.name&&g>0&&null!=u[h][0]&&null==u[h][g]);g++){if(null==u[h][g]||u[h][g].isInSun)continue;const{x:M,y:k,colorIndex:R}=u[h][g],B=Math.floor(M/C),S=Math.floor(k/C),I=(x+(1-2*x/y)*y/p*M)*t(),v=(x+(1-2*x/b)*b/1*k)*t();if(!n&&(a||l)&&(I<o||I>s||v<d||v>c))continue;const L=n&&m[B][S]<f||a&&m[B][S]<f||l&&i,H=r.isBackground?1:((u[h].length-g)/u[h].length)**w.aDRP;if(H>.001){let n;if("Layer"===A)n=e.color(...L?r.alternateColor:r.color);else if("Point"===A){const t=L?P:D,e=1===t.fg.length?[t.fg[0],t.l??t.fg[0]]:t.fg;n=r.isBackground?t.bg:e[Math.floor(R*e.length)]}else if("Linear Gradient"===A){const t=L?F:G;n=r.isBackground?e.color(...L?P.bg:D.bg):N(t[0],t[1],M/p)}else if("Reflected Gradient"===A){const t=L?F:G;n=r.isBackground?e.color(...L?P.bg:D.bg):W(t[0],t[1],M/p)}e.fill(e.hue(n),e.saturation(n),e.lightness(n),e.alpha(n)*H),e.ellipse(I,v,.001*t())}}if(function(t,e){e.noStroke(),e.rectMode(e.CORNER),e.fill(...D.c),e.rect(...[0,0,y,x].map((e=>e*t()))),e.rect(...[0,0,x,b].map((e=>e*t()))),e.rect(...[y,b,-y,-x].map((e=>e*t()))),e.rect(...[y,b,-x,-b].map((e=>e*t())));for(const n of q[k]){const o=x/2+n*(y-x)-x/2;e.rect(...[o,0,x,b].map((e=>e*t())))}}(t,e),!n){if(a){if(r===u)return e.noLoop(),a=!1,!0;r++}l&&(f+=i?1:-1)}}t.setup=()=>{!function(){d=[...E(),...B.map((t=>({...t,tG:t.tG.map((({x:t,y:e})=>({x:t,y:e+v.offset})))})))];for(let t=0;t<d.length;t++){const a=d[t],s={template:[],detail:[],columnLayers:[],height:a.layerHeight??0,isBackground:a.isBackground,isInverted:a.isInverted,color:a.isBackground?D.bg:o(D.fg),alternateColor:a.isBackground?P.bg:o(P.fg)},r=p/a.td;s.template=new Array(a.td+1).fill(void 0);for(const{x:t,y:e}of a.tG)s.template[Math.round(t*a.td)]={x:Math.round(t*a.td)/a.td*p,y:e,isGuideline:!0};for(let t=0;t<s.template.length;t++){const e=t*r;if(null==s.template[t]){const o=a.tG.findIndex((e=>e.x>t/a.td))-1,r=a.tG[o];if(null==r)continue;const l=a.tG[o+1];if(null==l)continue;const i=r.y+(l.y-r.y)*(e-r.x*p)/(l.x*p-r.x*p);let f;for(;;){if(a.isBackground){f=i;break}if(f=i+n(-a.tm,a.tm),r.y===l.y)break;if(!(f>=Math.max(r.y,l.y)||f<=Math.min(r.y,l.y)))break}s.template[t]={x:e,y:f}}}if(s.template=s.template.filter(Boolean),"Flowing"===w.name){const t=a.lSD??I;0===s.template[0].x&&1===t&&s.template.unshift({x:-.5*p,y:s.template[0].y}),s.template[s.template.length-1].x>=p&&-1===t&&s.template.push({x:1.5*p,y:s.template[s.template.length-1].y})}let l,i=s.template[0].y;for(let t=1;t<s.template.length;t++){l=s.template[t].y;const e=s.template[t].x,o=Math.round(a.dd/a.td),f=r/o;for(let r=0;r<o;r++){const o=s.template[t-1].x+r*f;s.detail.push({x:o,y:i});const u=f*(l-i)/(e-o);i+=n(u-a.dm,u+a.dm)}}s.detail.push({x:s.template[s.template.length-1].x,y:i});for(let o=0;o<(a.isBackground?w.bLRC??3:w.lRC??3);o++){const o=[],r=Math.min(...s.detail.map((t=>t.y))),l=Math.max(...s.detail.map((t=>t.y))),i=!R.isInverted||s.isBackground?Math.min(l+s.height,1):Math.max(r-s.height,0),f=1/w.xDen,u=Math.round(s.detail[0].x*w.xDen/p),m=Math.round(s.detail[s.detail.length-1].x*w.xDen/p)-u;for(let r=0;r<m;r++){const l=(u+r)*f*p,h=(s.detail.length-1)*r/(m-1)%1,d=Math.floor((s.detail.length-1)*r/(m-1)),g=Math.ceil((s.detail.length-1)*r/(m-1));let y,b;s.isBackground?s.isInverted?(y=1-s.height+n(-.3,.3),b=1):(y=0,b=s.height+n(-.3,.3)):(y=s.detail[d].y+h*(s.detail[g].y-s.detail[d].y),b=R.isInverted?i-(1-i)*e():i+(1-i)*e());const x=!R.isInverted||s.isBackground?Math.round(w.yDen*(b-y))*1.25**t:Math.round(w.yDen*(y-b))*1.25**t,M=!R.isInverted||s.isBackground?1/(x-1)*(b-y):1/(x-1)*(y-b);y+=n(-w.eYDis*M,w.eYDis*M);const D=[];for(let t=0;t<x;t++){const o=!R.isInverted||s.isBackground?y+t*M+M*n(-w.yDis/2,w.yDis/2):y-t*M+M*n(-w.yDis/2,w.yDis/2),r=l+(f/2+f*n(.5*-w.xDis,.5*w.xDis)+w.xDisp(t,s.isBackground,a.lSD??I))*p;D.push(O(r,o)?void 0:{x:r,y:o,isInSun:c(r,o,L,a.isBackground),colorIndex:e()})}o.push(D)}s.columnLayers.push(o)}g.push(s)}}(),G=Y(D),F=s(Y(P)),m=new Array(Math.ceil(p/C)).fill(0).map((t=>new Array(Math.ceil(1/C)).fill(0))),u=m.flat().length;const a=s(new Array(u).fill(0).map(((t,e)=>e)));for(let t=