How to initialize UIColor with white color

Rakesh Singh picture Rakesh Singh · Dec 12, 2011 · Viewed 38.5k times · Source

I am trying to initialize UIColor instance with whiteColor and I am not able to do it. The screen appears black if I do this:

color = [UIColor colorWithWhite:1.0 alpha:1.0];

But below line works fine ...

color = [UIColor colorWithRed:197.0/255.0 
                        green:169.0/255.0 
                         blue:140.0/255.0 
                        alpha:1.0];

I am sure I am doing something stupid, any ideas?

Answer

Fran Sevillano picture Fran Sevillano · Dec 12, 2011
UIColor *color = [UIColor whiteColor];