Drawing Triangles That are outlined and filled

Does anyone know of way to draw triangles in GL so that it is outlined in one color and filled in another?

There must be a better way to do it, but here’s one:

first draw your triangle using glPolygonMode(GL_FRONT_AND_BACK,GL_FILL) and use your desired color.
then draw the triangle again using glPolygonMode(GL_FRONT_AND_BACK,GL_LINES) using your outline color.

That’s the correct OpenGL way to do it.
The line mode is GL_LINE! GL_LINES is used elsewhere.
Lookup glPolygonOffset to find how you can avoid depth buffering artifacts of the lines in this case.