title: External Fill Color in iOS
body: <p>I have two rectangles (two closed sub <code>cgpaths</code>).
  Rectangle B is small and is present inside Rectangle A. All edges within it.
  Is there a direct way to fill color area external to the rectangle B.</p>
  
  <p><code>CAShapeLayer fillExternalColor</code> something like that? If not a direct way, how to do this programmatically?</p>
  
  <p>A - Purple color
  B - Yellow color</p>
  
  <p><img src="https://i.stack.imgur.com/iMbhH.png" alt="Drawing A and then drawing B">
  <img src="https://i.stack.imgur.com/sJgti.png" alt="Drawing B and then drawing A"></p>
  
  <p>So I tried drawing A and then drawing B. I wanted B to be of clear color (for now I put Yellow) but then I see purple color of A..</p>
  
  <p>I found CGRectIntersection method that gives AnB and CGRectUnion method that gives AuB.
  Is there a method that gives the rest of the area which is AuB - AnB?  </p>