OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import "ios/chrome/browser/ui/ntp/recent_tabs/views/views_utils.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #import "ios/chrome/browser/ui/uikit_ui_util.h" |
| 9 #import "ios/third_party/material_components_ios/src/components/Typography/src/M
aterialTypography.h" |
| 10 |
| 11 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 12 #error "This file requires ARC support." |
| 13 #endif |
| 14 |
| 15 namespace { |
| 16 |
| 17 // Text color. |
| 18 const int kTextColorBlue = 0x4285f4; |
| 19 const int kTextColorGray = 0x333333; |
| 20 |
| 21 // Subtitle text color. |
| 22 const int kSubtitleColorBlue = 0x7daeff; |
| 23 const int kSubtitleColorGray = 0x969696; |
| 24 |
| 25 // Colors for the icons. |
| 26 const int kIconColorBlue = 0x4285f4; |
| 27 const int kIconColorGray = 0x5a5a5a; |
| 28 |
| 29 } // namespace |
| 30 |
| 31 namespace recent_tabs { |
| 32 |
| 33 UILabel* CreateMultilineLabel(NSString* text) { |
| 34 UILabel* label = [[UILabel alloc] initWithFrame:CGRectZero]; |
| 35 [label setTranslatesAutoresizingMaskIntoConstraints:NO]; |
| 36 [label setText:text]; |
| 37 [label setLineBreakMode:NSLineBreakByWordWrapping]; |
| 38 [label setNumberOfLines:0]; |
| 39 [label setFont:[MDCTypography body1Font]]; |
| 40 [label setTextColor:UIColorFromRGB(kTextColorGray)]; |
| 41 [label setTextAlignment:NSTextAlignmentNatural]; |
| 42 [label setBackgroundColor:[UIColor whiteColor]]; |
| 43 return label; |
| 44 } |
| 45 |
| 46 UIColor* GetTextColorBlue() { |
| 47 return UIColorFromRGB(kTextColorBlue); |
| 48 } |
| 49 |
| 50 UIColor* GetTextColorGray() { |
| 51 return UIColorFromRGB(kTextColorGray); |
| 52 } |
| 53 |
| 54 UIColor* GetSubtitleColorBlue() { |
| 55 return UIColorFromRGB(kSubtitleColorBlue); |
| 56 } |
| 57 |
| 58 UIColor* GetSubtitleColorGray() { |
| 59 return UIColorFromRGB(kSubtitleColorGray); |
| 60 } |
| 61 |
| 62 UIColor* GetIconColorBlue() { |
| 63 return UIColorFromRGB(kIconColorBlue); |
| 64 } |
| 65 |
| 66 UIColor* GetIconColorGray() { |
| 67 return UIColorFromRGB(kIconColorGray); |
| 68 } |
| 69 |
| 70 } // namespace recent_tabs |
OLD | NEW |