Draw using Three.js and es6 N cubes. Each of the vertices of which has its own color, when you click on it - the edges of the cube emanating from this vertex must change color to the color of the vertex.
html-page: https://belozercevaa.github.io/three.js-test/dist/