Basically, I'm generating a random graph with D3.js and I would like to generate a random fill-color and border-color for each node, the border color has to be a shade of the fill color. I'm currently using something like this to generate random fill-color:
randomColor() {
const r = () => Math.floor(256 * Math.random());
return {color: `rgb(${r()}, ${r()}, ${r()})`, border: `rgb(${r()}, ${r()}, ${r()})`};
}
But the border is also random so it's not linked with the main color.
Thanks in advance.