1

Need to change selected object color by using eyedropper, color i can get using this way:

canvas.on('mouse:up', function (e) {
    var c = document.getElementById("c");
    var ctx = c.getContext("2d");
    var imgData = ctx.getImageData(canvas.getPointer().x, canvas.getPointer().y, 1, 1);
    alert("rgb " + imgData.data[0] + " " + imgData.data[1] + " " + imgData.data[2]);
});

But clicking somewhere selects other or deselects current object. Any way to disable all events temporary?

Setting selectable = false on object is also not a solution since current object will be deselected if clicked on background or other object.

user2455079
  • 420
  • 4
  • 16

1 Answers1

0

loop trough all objects and set evented to false will work.

canvas.getObjects().forEach((obj, index) => {
       obj.evented = false;
});
Fida Khattak
  • 91
  • 2
  • 7