CGPath disguised as CGPoints

I am trying to build this: enter image description here

If the white background is actually transparent. I know how to copy CGPath to a given area, but this seems like a different path, since I need to subtract regions from the filled CGPath.

I assume that the correct way would be to subtract all outer circles from CGPath and then draw smaller circles in my CGPoints, but I'm not sure how to accomplish the first. Can someone point me in the right direction?

+4
source share
2 answers

What would I do:

1) Draw your general line

2) CGContextSetBlendMode(context, kCGBlendModeClear) to "clear the context" when drawing.

3) Draw more circles

4) CGContextSetBlendMode(context, kCGBlendModeNormal) to return to the normal drawing

5) Draw your little circles.

+7
source

Instead, you can start the transparency layer, draw lines, then draw large transparent circles using a transparent color, then draw smaller black circles. Then, when you finish the transparency layer, it will be exactly what you want to return to the context.

+1
source

Source: https://habr.com/ru/post/1340509/


All Articles