How do I find out the color under the mouse pointer on a GUI element?

Hey, as in the title, I need to find out the color that is under my mouse pointer on a GUI element. In a picture. A color picker.

You could use editable images for that.

First get the mouse position relative to image by subtracting the gui’s absolute position from the mouses. Then the problem is of the image scaling. You could use editable image’s resize method to resize it to the guis absolute size or use much more complex maths but I suggest just using resize method as it’s easier on the head. After that just get the pixel using EditableImage:ReadPixel(position,Vector3.one) which would return a table of 4 values, R,G,B,A where A is the alpha value. Also note this is in 0-1 range.

1 Like

I don’t think its possible with a random image. I’m pretty sure most color pickers use math to determine a color based on positions detected.

If editable image can do it, that won’t help if its not even out yet for production games.

I cant use math for it. I don’t know what colors there in the GUI.