diff options
author | Vitaly Takmazov | 2016-08-15 00:54:41 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-08-15 00:54:41 +0300 |
commit | a778c55cd848b0d0d452a20e8eaf6a477c068ca3 (patch) | |
tree | 4806924f036eff97cbbd623c23234aea68afc80e /Juick | |
parent | c2a3fddc05e971351f919b1490869cb11e78ee30 (diff) |
colors
Diffstat (limited to 'Juick')
-rw-r--r-- | Juick/AppDelegate.m | 8 | ||||
-rw-r--r-- | Juick/ColorScheme.h | 4 | ||||
-rw-r--r-- | Juick/ColorScheme.m | 19 | ||||
-rw-r--r-- | Juick/MessagesViewController.m | 3 | ||||
-rw-r--r-- | Juick/RevealPanelViewController.m | 16 |
5 files changed, 20 insertions, 30 deletions
diff --git a/Juick/AppDelegate.m b/Juick/AppDelegate.m index 576e11e..5fe48fe 100644 --- a/Juick/AppDelegate.m +++ b/Juick/AppDelegate.m @@ -21,13 +21,11 @@ { // style the navigation bar if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1) { - [[UINavigationBar appearance] setBarTintColor:[ColorScheme navbarBackground]]; - [[UINavigationBar appearance] setTintColor:[ColorScheme navbarFont]]; - [[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [ColorScheme navbarFont]}]; + [[UINavigationBar appearance] setTintColor:[ColorScheme linkColor]]; + [[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [ColorScheme linkColor]}]; } - // make the status bar white - [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent; + [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault; NSURL *baseURL = [NSURL URLWithString:@"https://api.juick.com"]; RKObjectManager *objectManager = [RKObjectManager managerWithBaseURL:baseURL]; diff --git a/Juick/ColorScheme.h b/Juick/ColorScheme.h index 275962c..de69689 100644 --- a/Juick/ColorScheme.h +++ b/Juick/ColorScheme.h @@ -10,8 +10,8 @@ @interface ColorScheme : NSObject -+(UIColor *) navbarBackground; ++ (UIColor *)colorWithHex:(UInt32)col; + +(UIColor *) mainBackground; -+(UIColor *) navbarFont; +(UIColor *) linkColor; @end diff --git a/Juick/ColorScheme.m b/Juick/ColorScheme.m index 257cc72..8417489 100644 --- a/Juick/ColorScheme.m +++ b/Juick/ColorScheme.m @@ -15,21 +15,22 @@ [super initialize]; } +// takes 0x123456 ++ (UIColor *)colorWithHex:(UInt32)col { + unsigned char r, g, b; + b = col & 0xFF; + g = (col >> 8) & 0xFF; + r = (col >> 16) & 0xFF; + return [UIColor colorWithRed:(float)r/255.0f green:(float)g/255.0f blue:(float)b/255.0f alpha:1]; +} + + (UIColor *) mainBackground { return [UIColor colorWithRed:238/255.0f green:238/255.0f blue:229/255.0f alpha:1.0f]; } + (UIColor *) linkColor { - return [UIColor colorWithRed:0/255.0f green:102/255.0f blue:153/255.0f alpha:1.0f]; -} - -+ (UIColor *) navbarBackground { - return [UIColor colorWithRed:51/255.0f green:51/255.0f blue:51/255.0f alpha:1.0f]; -} - -+ (UIColor *) navbarFont { - return [UIColor colorWithRed:153/255.0f green:154/255.0f blue:153/255.0f alpha:1.0f]; + return [self colorWithHex:0x006699]; } diff --git a/Juick/MessagesViewController.m b/Juick/MessagesViewController.m index 24b8185..fe2c14d 100644 --- a/Juick/MessagesViewController.m +++ b/Juick/MessagesViewController.m @@ -72,9 +72,6 @@ static NSString *CellIdentifier = @"MessageCell"; // TODO: add to thread view too [self.view addGestureRecognizer:[revealController panGestureRecognizer]]; } - if (NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_6_1) { - self.navigationController.navigationBar.tintColor = [ColorScheme navbarBackground]; - } [self.tableView registerNib:[UINib nibWithNibName:@"MessageCell" bundle:nil] forCellReuseIdentifier:CellIdentifier]; self.tableView.rowHeight = UITableViewAutomaticDimension; diff --git a/Juick/RevealPanelViewController.m b/Juick/RevealPanelViewController.m index 1e9fb7b..d890f97 100644 --- a/Juick/RevealPanelViewController.m +++ b/Juick/RevealPanelViewController.m @@ -38,13 +38,9 @@ static NSString *CellIdentifier = @"NavCell"; - (void)viewDidLoad { [super viewDidLoad]; - - if (NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_6_1) { - self.navigationController.navigationBar.tintColor = [ColorScheme navbarBackground]; - } - [self.view setBackgroundColor:[ColorScheme navbarBackground]]; + [self.view setBackgroundColor:[ColorScheme mainBackground]]; self.tableView = [[UITableView alloc] init]; - [self.tableView setBackgroundColor:[ColorScheme navbarBackground]]; + [self.tableView setBackgroundColor:[ColorScheme mainBackground]]; self.tableView.delegate = self; self.tableView.dataSource = self; [self.tableView setSeparatorInset:UIEdgeInsetsZero]; @@ -114,12 +110,10 @@ static NSString *CellIdentifier = @"NavCell"; - (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NavCell * cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; NSInteger row = indexPath.row; - [cell.contentView setBackgroundColor:[ColorScheme navbarBackground]]; + [cell.contentView setBackgroundColor:[UIColor whiteColor]]; cell.icon.font = [UIFont fontWithName:kFontAwesomeFamilyName size:32.f]; - cell.icon.textColor = [ColorScheme navbarFont]; - //cell.iconLabel.backgroundColor = [ColorScheme navbarBackground]; - //cell.descriptionTextLabel.backgroundColor = [ColorScheme navbarBackground]; - cell.descriptionText.textColor = [ColorScheme navbarFont]; + cell.icon.textColor = [ColorScheme linkColor]; + cell.descriptionText.textColor = [ColorScheme linkColor]; if (row == 0) { cell.descriptionText.text = @"My feed"; cell.icon.text = [NSString fontAwesomeIconStringForEnum:FAIconHome]; |