I'm alternating the fill color of a shape between two different colors many times a second. The eye blends those two colors together to a single color using the persistence of vision theory. In the simplest case, the two colors are pure black and pure white. I want to pick a background color so that if I placed the alternating shape on the background, it would disappear. I tried using this code
https://stackoverflow.com/a/40961645/289635
which mixes the two colors equally.
bgColor = UIColor.blend( color1: UIColor.black, color2: UIColor.white)
That gave me a gray background that was too dark and I could easily see my shape. If I turned down the intensity of the black to 25%, the shape blended into the background in much better.
bgColor = UIColor.blend( color1: UIColor.black, intensity1: 0.25, color2: UIColor.white, intensity2: 0.75)
What is the right way to combine two colors in this situation?