How do I create a polygon in OpenGL 4.1 that has an inset border of n-pixels?
Presumably, since I have said the magic word "pixel", this means that I need to invoke a fragment shader of some form. (And, even though I said "pixel", this might need to be "pixel distance from edge" or some similar metric).
In addition, since I said the word "inset" (ie. I don't want any of the outline pixels to render outside the rendered polygon), I probably have invoked a stencil buffer. And may have invoked the idea of multiple passes.
However, I seem to be at a loss for how to put the pieces together to make the outline.
Here is what I mean in pictures (I chose rectangles simply because they are the easiest to define what an n-pixel outline is as well as decompose into the constituent triangles cleanly):
This is a blue rectangle with a 2 pixel wide blue border:
This is a blue rectangle with a 3 pixel wide red border: