0

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?

David Smith
  • 252
  • 4
  • 10
  • In theory, a 50% blend of each color would be correct, but displays don't change instantaneously. The same might be true of the cones in your eyes, so you will probably see different results for OLED vs. LCD displays, the result may vary due to the brightness setting of your screen, and you perhaps might even have different results for different observers. – vacawama Apr 20 '19 at 11:46
  • 1
    Add a slider that controls `intensity1`. Give the app to different people, use different pairs of colors, and let them slide the slider until the shape disappears. See if you can find a pattern. – Sweeper Apr 20 '19 at 12:13
  • This type of color mixing probably would be best described as using "persistence of vision". – David Smith Apr 20 '19 at 12:32

0 Answers0