How to create a footprint system in 2D

How would a material get the color of the ground? A line trace doesn’t give color output right?