title: Assigning colors to vertices in a geometry in Three.js
body: <p>This question was previously asked here: <a href="https://stackoverflow.com/questions/10330342/threejs-assign-different-colors-to-each-vertex-in-a-geometry">Threejs: assign different colors to each vertex in a geometry</a>, but it is quite old, and so the provided solutions don't work with current versions of three.js (which no longer provides the attribute <em>vertexColors</em> for the Geometry class).</p>
  
  <p>I know that it's possible to set the color of each <em>face</em> of a geometry, but I am setting the vertices of a sphere to different distances, and I wish to simultaneously modulate the color of each vertex dependent on its distance from the centre.</p>