getLineVertexShader = ({ colorMode, color }) => `
// Amount of transparency for line, calculated in Animate
attribute float color;

// Calculate color based on line position
varying vec3 vColor;
varying float alpha;

void main() {
  vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
  gl_Position = projectionMatrix * mvPosition;

  ${colorMode === 'rainbow' ? rainbowLineColors : ''}
  ${colorMode === 'solid' ? solidLineColors({ color }) : ''}
  alpha = color;
}
`
Generates a vertex shader for a connecting line in a particle system

This shader uses the position of particles to determine their color
and change them as they move