Creating 2d shapes with code and filling them

In Using vectrosity to make 2D shapes programmatically and modify them. It works great. However vectrosity does not support filling shapes with materials, colors or textures. Are there any suggestions to how this could be done?

My approach would be to fill the shape with a Mesh to draw the material.

The following outlines an approach to filling 2D shapes with the scanline method: