What is the minimum number of colors required to paint all the vertices, edges, and diagonals of a convex n-gon, given that the following two conditions must be met:
- Any two segments emerging from the same vertex must be different colors;
- The color of any vertex must be different from the color of any segment emerging from it?