Is there a way to apply a texture to a 2d collider?

I want to make a level editor for a 2d platformer and I figured I would create polygon colliders with a script and apply textures to them to simulate terrain.

It would look something like this:

Or is there a simpler way to achieve something similar?

the keyword is not “collider”, but “mesh”. i am not sure about 2d. but if there is nothing designed for 2d mesh. i think you have to generate a mesh based on the polygon collider 2d. add it to a gameobject with MeshRenderer and MeshFilter