Yes. The color needs to be drawn on the screen for at least a frame. In a previous post, I used a boolean variable.
If readColor is true then do something
Some conditions then set readColor
The variable is changed after it’s read. So, it can’t change it won’t be changed in the same frame.
See this thread
https://forum.gdevelop.io/t/collision-mask-index/74196
In the end, I came up with the idea to use a tiled sprite that was only a pixel or 2 in size. You can then change the tiled sprite offset to position the visible pixel. It’s a bit like moving an image behind a window or a pin hole.
Depending on the concept a mathematical approach might also work. I’m still insure of what chooses the color. Think of the object divided into sections equal to the number of colors.