Skip to content

Instantly share code, notes, and snippets.

@zackshapiro
Last active May 3, 2019 15:15
Show Gist options
  • Save zackshapiro/d9e39735e3c6edad72ae8ddf3ecb1a40 to your computer and use it in GitHub Desktop.
Save zackshapiro/d9e39735e3c6edad72ae8ddf3ecb1a40 to your computer and use it in GitHub Desktop.
rgb.forEach((color, i) => {
var slider = d3
.sliderBottom()
.min(0)
.max(255)
.step(1)
.width(300)
.ticks(0)
.default(rgb[i])
.displayValue(false)
.fill(colors[i])
.handle(
d3
.symbol()
.type(d3.symbolCircle)
.size(200)()
)
.on('onchange', num => {
rgb[i] = num;
blob.style.fill = `#${num2hex(rgb)}`;
});
gColorPicker
.append('g')
.attr('transform', `translate(30,${60 * i})`)
.call(slider);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment