MCPcopy
hub / github.com/chronark/highstorm / drawCircle

Function drawCircle

apps/web/components/landing/particles.tsx:133–147  ·  view source on GitHub ↗
(circle: Circle, update = false)

Source from the content-addressed store, hash-verified

131 const rgb = hexToRgb(color);
132
133 const drawCircle = (circle: Circle, update = false) => {
134 if (context.current) {
135 const { x, y, translateX, translateY, size, alpha } = circle;
136 context.current.translate(translateX, translateY);
137 context.current.beginPath();
138 context.current.arc(x, y, size, 0, 2 * Math.PI);
139 context.current.fillStyle = `rgba(${rgb.join(", ")}, ${alpha})`;
140 context.current.fill();
141 context.current.setTransform(dpr, 0, 0, dpr, 0, 0);
142
143 if (!update) {
144 circles.current.push(circle);
145 }
146 }
147 };
148
149 const clearContext = () => {
150 if (context.current) {

Callers 2

drawParticlesFunction · 0.85
animateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected