You appear to be painting rectangles with filled foregrounds instead of filled backgrounds, which is fine. So what is really your problem. You are not clear as to what you need!
You can use case statements instead of those if conditionals. And for clarity, change WIDTH, WIDTH, to WIDTH, HEIGHT, even though WIDTH = HEIGHT. You do use a width, height in your code but you don't show their declarations.
for calculating the arc/circle centers. That way you merely lookup the coordinate and don't have to calculate it each time.
The built in offsets gives you your borders!
If you need a different colored edge then the game background then increase the rectangle size, paint your color, then repaint using the correct size. You now have a border.