Preserve color of a state in mouseover function in d3
<p>I have a map created from a geojson using d3.js lib and I colored randomly different states of map. Now I want to get color of a state when I hover it in mouseover function :</p>

<pre><code>var lastColor;

function mouseover(d) {
     lastColor = d.color; //This code is not works for me

     d3.select(this)
         .style('fill', 'orange')
         .style('cursor', 'pointer');
}

function mouseout(d) {
    d3.select(this)
         .style('fill', lastColor);
}
</code></pre>

<p>Is it possible to get the color from d so that I return to this color when I mouseout from this state ? </p>