Offsetting Polygon

I want to create a polygon around another polygon. The area between both polygons should be marked.
I can do it successful with easy polygons, but when the structure become complicated, the color become different because of areas that cover another areas.
The algorithm called “Offsetting Polygon”.
I am looking for the implementation of that algorithm.
Thank you

Can you share a screenshot or a Sandcastle example reproducing the issue? See instructions here: How to share custom Sandcastle examples.

If you have a screenshot of what is the desired result that would be helpful too.