Closed beocaca closed 2 years ago
hello, i need to get the hex color example document :
var color = d3.scaleLinear() .domain([10, 100]) .range(["brown", "steelblue"]); color(20); // "#9a3439" color(50); // "#7b5167"
but i get the rgba color
color(20); // "rgb(154, 52, 57)" color(50); // "rgb(123, 81, 103)"
You can use d3.rgb("rgb(154, 52, 57)").formatHex(). You can also write your own interpolate that generates hexadecimal strings with the scale if you prefer.
d3.rgb("rgb(154, 52, 57)").formatHex()
hello, i need to get the hex color example document :
but i get the rgba color