Friends, there is a problem with changing the transparency of UIView elements. Change it like this: UIView.alpha = value. If I try to increase visibility in increments of 0.01 - the image "blinks". That is, say, with a value of 0.05, the view may be worse than at 0.04. With a gradual increase in visibility in increments of 0.01, there may be a situation where the view can be seen better-better-worse-better-worse-better-better-better, etc. I don’t understand what it is. He created a micro project that reflects this - it can be seen in the simulator and on a real device (he immediately sinned on the screen). If you help / see the project - I will be very grateful. Project: https://goo.gl/vS2aLX
- I noticed that if you set up a UIView appearance animation from alpha = 0.0 to alpha = 1.0 with a duration of 10 or 20 seconds, the UIView will blink a lot. That is what I am talking about in the original post is very clearly visible. - GenDru
- For a start, you have a combination of colors such that 0.3 is difficult to distinguish from 0.6, not like 0.04 from 0.05. How do you change from 10 to 1 in 10 seconds, give an example. PS flashing is not played: youtube.com/watch?v=wuOoSvU5i-Q - VAndrJ
- Here is a video with a transition from visibility 0 to visibility 1 in 20 seconds. Well seen as blinking. I think I see flicker on your video. youtu.be/in34amFvyOE - GenDru
- Project goo.gl/0b4lRt - GenDru
|
1 answer
I tried to take the color ricker color for every 10% alpha. - took about one place.
- 10 - # 6664da
- 20 - # 6766db
- 30 - # 6966dd
- 40 - # 6b67de
- 50 - # 6c69df
- 60 - # 6d6be1
- 70 - # 6f6ce2
- 80 - # 706de4
- 90 - # 726ee6
- 100- # 7470e7
Constantly increasing.
Moreover, for example, if you measure every 0.01 between 0.1 and 0.2, then the results are
- 10 - # 6664da
- 11 - # 6664da
- 12 - # 6664da
- 13 - # 6665db
- 14 - # 6665da
- 15 - # 6665da
- 16 - # 6665db
- 17 - # 6665db
- 18 - # 6765da
- 19 - # 6765db
- 20 - # 6765db
As you can see, when 13 turns into 14, the picture really becomes darker, and a similar effect is observed when you go 17-18 where the red channel becomes brighter and the blue is darker.
I will assume that these are artifacts in floating point operations, and it will not be possible to solve this program by any means.
Perhaps the problem can be solved using sRGB added in iOS10.
|