MCPcopy Create free account
hub / github.com/collidingScopes/iron-interface / createParticleTexture

Function createParticleTexture

geometry.js:591–617  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

589}
590
591function createParticleTexture() {
592 const canvas = document.createElement('canvas');
593 canvas.width = 64;
594 canvas.height = 64;
595
596 const context = canvas.getContext('2d');
597 const gradient = context.createRadialGradient(
598 canvas.width / 2,
599 canvas.height / 2,
600 0,
601 canvas.width / 2,
602 canvas.height / 2,
603 canvas.width / 2
604 );
605
606 gradient.addColorStop(0, 'rgba(255,255,255,1)');
607 gradient.addColorStop(0.2, 'rgba(255,255,255,0.8)');
608 gradient.addColorStop(0.4, 'rgba(255,255,255,0.4)');
609 gradient.addColorStop(1, 'rgba(255,255,255,0)');
610
611 context.fillStyle = gradient;
612 context.fillRect(0, 0, canvas.width, canvas.height);
613
614 const texture = new THREE.Texture(canvas);
615 texture.needsUpdate = true;
616 return texture;
617}
618
619// --- COLOR PALETTES ---
620const colorPalettes = [

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected