For a shape with more sides, such as a hexagon, it would be necessary to define polygon points for each angle in the object. There are many ways to identify a colour when creating vector graphics.
star and a wide variety of different shapes. Rectangle is actually a type of polygon but given the frequency of its use, most vector graphic file formats support a specific rectangle object.
Further reading: How to create custom Windows icons from your own images A vector graphic is not based on pixels, but on ...