Skip to content

Instantly share code, notes, and snippets.

@blturner
Created January 8, 2015 23:00
Show Gist options
  • Save blturner/6f089fcf6cdab8ef5205 to your computer and use it in GitHub Desktop.
Save blturner/6f089fcf6cdab8ef5205 to your computer and use it in GitHub Desktop.
var through = require('through')
var colorjoe = require('colorjoe')
module.exports = create_picker
var stream = through()
function create_picker(el, defaultColor) {
var joe = colorjoe.rgb(
el
, defaultColor || '#ff0000'
, ['hex']
)
joe.on('done', onDone)
return stream
}
function onDone(color) {
stream.queue(color.hex())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment