title: Change the color of nodes on double click in D3
body: <p>I want the color of node to change on double click. i.e. On the first double click, it would turn black but on re-double clicking it, it would turn back to its original color. I am able to make it turn black on the first double click, but I'm not able to make it turn back to its original color.  Thanks in advance and here is my code. </p>
  
  <pre><code>var gnodes = svg.selectAll('g.gnode')
                  .data(graph.nodes)
                  .enter()
                  .append('g')
                  .classed('gnode', true);
  
  var node = gnodes.append("circle")
                   .attr("class", "node")
                   .attr("r", 5)
                   .style("fill", function(d) {return d.colr; })
                   .on('dblclick', function (d)
                   {
                           if (d3.select(this).style("fill") != "black")
                              {
                                  d3.select(this).style("fill", "black");
                              }
                          else
                              {
                                  d3.select(this).style("fill", function(d){return d.colr;});
                              }
                  })
                  .call(force.drag);
  </code></pre>