Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does 70% grey mean and how do I specify this in UIColor?

I'd like to replicate the default color of the UITextField placeholder field. From the documentation:

The placeholder string is drawn using a 70% grey color.

  1. What does 70% mean in this statement?
  2. What is the best way to initialize UIColor with this color, preferably in a way that shows the color is "70% grey"?
like image 567
MikeG Avatar asked Feb 09 '12 21:02

MikeG


1 Answers

This is 70% grey:

UIColor* grey70 = [UIColor colorWithWhite: 0.70 alpha:1];

It is white but only 70% of the maximum brightness (1.0).

1.0 is pure white, 0.5 is middle grey, 0.0 is black.

like image 187
progrmr Avatar answered Sep 26 '22 22:09

progrmr