1441dcd67a
Left click colorpicker tool: - Create PRIMARY/SECONDARY_COLOR_SELECTED/UPDATED events - remove isPrimary arguments
25 lines
562 B
JavaScript
25 lines
562 B
JavaScript
/*
|
|
* @provide pskl.drawingtools.ColorPicker
|
|
*
|
|
* @require pskl.utils
|
|
*/
|
|
(function() {
|
|
var ns = $.namespace("pskl.drawingtools");
|
|
|
|
ns.ColorPicker = function() {
|
|
this.toolId = "tool-colorpicker";
|
|
this.helpText = "Color picker";
|
|
};
|
|
|
|
pskl.utils.inherit(ns.ColorPicker, ns.BaseTool);
|
|
|
|
/**
|
|
* @override
|
|
*/
|
|
ns.ColorPicker.prototype.applyToolAt = function(col, row, color, frame, overlay) {
|
|
if (frame.containsPixel(col, row)) {
|
|
var sampledColor = frame.getPixel(col, row);
|
|
$.publish(Events.PRIMARY_COLOR_SELECTED, [sampledColor]);
|
|
}
|
|
};
|
|
})();
|