An HTML5 color picker.
Note: Uses HTML5 canvas features:
- "Fingerprinting" may be blocke by your browser
- This script does not work without it
- You have to click on the image and select "Allow HTML5 canvcas image data".
Copyright (C) 2014-2015 Denis Meyer
1.0.0
{
debug: true/false, // default: false
log: logFunction, // default: console.log when debug == true
canvasId: "theImageCanvasId",
imgSrc: "path/to/the/image",
livePreview: true/false, // default: false
livePreviewId: "thePreviewDivID" // default: ""
}
Colorpicker.js uses events to publish when a color has been picked by the user. Simply subscribe to the event to get the selected color.
- r
- g
- b
- hex
When a color has been picked
$(document).on("cp:colorpicked", function (e, r, g, b, hex) {
// Do something...
});