Last active
May 3, 2019 15:15
-
-
Save zackshapiro/d9e39735e3c6edad72ae8ddf3ecb1a40 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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