Detects whether or not a point is inside a polygon. (Here, the point is your cursor.) If true, the polygon turns green. How does this work? It casts a ray from your point upwards, and counts the intersections of that ray to the edges of the polygon. If the intersections are odd, then the point is outside the polygon. If even, then it is inside the polygon. The darkened edges are those ones the ray crosses. All the code is by me, but got the idea from @awesome-llama