25

The default UIButton round rectangle is that dark blue. I want my cell's text in a table to match this blue color.

I am using this code but the only blue I can find is a bright blue...

cell.textLabel.textColor = [UIColor blueColor];

3 Answers 3

36

The system button text color for iOS 7 and above is:

Swift:

UIColor(red: 0, green: 0.478431, blue: 1, alpha: 1)

Objective-C:

[UIColor colorWithRed:0 green:0.478431 blue:1 alpha:1]
3
  • 4
    This is the correct answer. UIColor* theColor = _yourButton.currentTitleColor; NSLog(@"title color: %@",theColor"); if further proof required.
    – arcady bob
    Commented Jul 14, 2016 at 21:36
  • 1
    Proof in Swift: print(UIButton(type: .System).currentTitleColor)
    – ma11hew28
    Commented Sep 2, 2016 at 15:43
  • 2
    @arcadybob has the right idea. And if you don't already have a button object you can just do something like UIColor *systemTextColor = [[[UIButton buttonWithType:UIButtonTypeSystem] titleLabel] textColor]; cell.textLabel.textColor = systemTextColor;
    – James C
    Commented Sep 25, 2017 at 23:02
18

Use this code to set the color using RGB value

cell.textLabel.textColor = [UIColor colorWithRed:.196 green:0.3098 blue:0.52 alpha:1.0];
0
4

The color in iOS6 is:

[UIColor colorWithRed:0.22 green:0.33 blue:0.53 alpha:1.0]
1
  • do you have a source for this by chance?
    – toblerpwn
    Commented Dec 8, 2012 at 20:20