Widget for picking a color from an image

0
Hello All,   Is there a widget which will pick a color from where i have clicked on an image just like we have in paint? Color picker widget that we have in App store gives me color palette to pick a color from which is not what i want.   Thanks, Guru
asked
2 answers
2

I could imagine, you create a java script action with this code from https://www.reddit.com/r/learnjavascript/comments/31glai/color_selector_help/

 

$(window).on("click", function(ev) {
  var x = ev.clientX;
  var y = ev.clientY;

  html2canvas(document.body).then(function(canvas) {
     var ctx = canvas.getContext('2d');
     var p = ctx.getImageData(x, y, 1, 1).data; 
     var hex = "#" + ("000000" + rgbToHex(p[0], p[1], p[2])).slice(-6);
     console.log(hex);
  });
});

 

answered
0

No there is not as far as I know. I think your best option is to modify the Color picker widget by replacing its color palette by an uploadable image.

answered