Created
January 8, 2015 23:00
-
-
Save blturner/6f089fcf6cdab8ef5205 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
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