Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIColor clearColor

The documentation says the clearColor's grayscale and alpha = 0. What does that actually mean? Is it just a color to match whatever the background is?

like image 863
Crystal Avatar asked May 26 '11 21:05

Crystal


2 Answers

clearColor is exactly what it says, its clear, so whatever the color is of the view behind the clearColor view, will show through. Think of it as being like clear glass, it is see through e.g. has an alpha value of 0 (zero).

So, say your window background is Red and the background of the view you place on on top of it is clearColor then you will see Red...

like image 109
Matt Avatar answered Oct 11 '22 13:10

Matt


Not sure if you wanted the individual definitions. Yes, the [UIColor clearColor] is transparent. However specific to "The documentation says the clearColor's grayscale and alpha = 0. What does that actually mean?"

a) A grayscale of 0 is equal to the color black.

b) alpha is equal to opacity where 1 is solid and 0 is transparent.

Therefore the documentation is saying that clearColor is the color black with a completely transparent opacity. (which makes what color it is immaterial)

Basically whatever color/image is behind it will shine through with 100% clarity.

like image 40
dredful Avatar answered Oct 11 '22 14:10

dredful