Is there any method or plugin for picking the color of a pixel in Construct 2 like photoshop ar any other drawing app?
I want to just get the RGB value of a given pixel (like x,y). If anyone knows, please help me.
Well there is the color picker tool in the image editor.
If you mean at runtime, C2 packs the rgb() system expression.
There is the third-part plugin named "Canvas" that also seems to have a rgbat() expression that might work, but IIRC it may have issues with WebGL.
It is possible but usually inadvisable, unless it is something like the picker. Why do you want to do this ?
Develop games in your browser. Powerful, performant & highly capable.
I just want to get RGB value at any (x,y) position at C2 runtime
That's going to involve hacking WebGL and/or Canvas. There's probably a better way to do it.
How??? Please describe..
This expression will get the red of the pixel under the mouse:
Browser.ExecJS("var canvas=document.getElementById('c2canvas'); var ctx=canvas.getContext('2d'); var pixel=ctx.getImageData("&int(LayerToCanvasX(0, mouse.x, mouse.y))&","&int(LayerToCanvasY(0, mouse.x, mouse.y))&",1,1); pixel.data[0];")[/code:3193z21z] You can get the other color components by changing the 0 in pixel.data[0] to 1 for green 2 for blue 3 for alpha