What color is the text of a default UIButton?
ios, uibutton, uicolor, xcode
Solution
Try the following:
CGFloat red;
CGFloat green;
CGFloat blue;
CGFloat alpha;
UILabel *buttonLabel = [yourButton titleLabel];
UIColor *textColor = [buttonLabel textColor];
[textColor getRed:&red green:&green blue:&blue alpha:&alpha];
Now red, green, blue and alpha will contain the values you're looking for:
NSLog(@"Red: %f Green:%f Blue:%f Alpha:%f", red, green, blue, alpha);
For iOS 6 this will return:
Red:0.220000 Green:0.330000 Blue:0.530000 Alpha:1.000000
Problem
What color is the text of a default `UIButton`? I am trying o recreate it in some table view cells but not having luck. The closest I have come is: ``` [UIColor colorWithRed:0/255.0 green:51.0/255.0 blue:102.0/255.0 alpha:1]; ``` Is that color, font size and style documented anywhere?