Skip to content

Commit

Permalink
#1273 (making dark themes darker)
Browse files Browse the repository at this point in the history
- The Dark theme now uses pure black for the story background, and some other darker colors.
- The Medium theme now also uses darker colors.
  • Loading branch information
Dejal committed Feb 21, 2020
1 parent fd605e0 commit 1692e58
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions clients/ios/Classes/StoryDetailViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1878,6 +1878,8 @@ - (void)updateStoryTheme {
[ThemeManager themeManager].themeCSSSuffix];

[self.webView stringByEvaluatingJavaScriptFromString:jsString];

self.webView.backgroundColor = UIColorFromLightDarkRGB(0x707070, 0x404040);
}

- (BOOL)canHideNavigationBar {
Expand Down
4 changes: 2 additions & 2 deletions clients/ios/Classes/StoryPageControl.m
Original file line number Diff line number Diff line change
Expand Up @@ -782,9 +782,9 @@ - (void)updateTheme {
[super updateTheme];

self.navigationController.navigationBar.tintColor = [UINavigationBar appearance].tintColor;
self.navigationController.navigationBar.barTintColor = [UINavigationBar appearance].barTintColor;
self.navigationController.navigationBar.barTintColor = UIColorFromLightSepiaMediumDarkRGB(0xE3E6E0, 0xFFFFC5, 0x222222, 0x111111);
self.navigationController.navigationBar.backgroundColor = [UINavigationBar appearance].backgroundColor;
self.view.backgroundColor = UIColorFromRGB(0xe0e0e0);
self.view.backgroundColor = UIColorFromLightDarkRGB(0xe0e0e0, 0x111111);

[self updateAutoscrollButtons];
[self updateTraverseBackground];
Expand Down
8 changes: 4 additions & 4 deletions clients/ios/Classes/ThemeManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ - (UIColor *)themedColorFromRGB:(NSInteger)rgbValue {
if (rgbValue == 0x8F918B) {
return [UIColor colorWithWhite:0.7 alpha:1.0];
} else if (red < 0.5 && green < 0.5 && blue < 0.5) {
return [UIColor colorWithRed:1.0 - red green:1.0 - green blue:1.0 - blue alpha:1.0];
return [UIColor colorWithRed:1.2 - red green:1.2 - green blue:1.2 - blue alpha:1.0];
} else {
return [UIColor colorWithRed:red - 0.5 green:green - 0.5 blue:blue - 0.5 alpha:1.0];
return [UIColor colorWithRed:red - 0.7 green:green - 0.7 blue:blue - 0.7 alpha:1.0];
}
} else if ([theme isEqualToString:ThemeStyleSepia]) {
CGFloat outputRed = (red * 0.393) + (green * 0.769) + (blue * 0.189);
Expand Down Expand Up @@ -279,8 +279,8 @@ - (void)prepareForWindow:(UIWindow *)window {

- (void)setupTheme {
[UINavigationBar appearance].tintColor = UIColorFromLightSepiaMediumDarkRGB(0x0, 0x0, 0x9a8f73, 0x9a8f73);
[UINavigationBar appearance].barTintColor = UIColorFromLightSepiaMediumDarkRGB(0xE3E6E0, 0xFFFFC5, 0x4A4A4A, 0x222222);
[UINavigationBar appearance].backgroundColor = UIColorFromLightSepiaMediumDarkRGB(0xE3E6E0, 0xFFFFC5, 0x4A4A4A, 0x222222);
[UINavigationBar appearance].barTintColor = UIColorFromLightSepiaMediumDarkRGB(0xE3E6E0, 0xFFFFC5, 0x333333, 0x222222);
[UINavigationBar appearance].backgroundColor = UIColorFromLightSepiaMediumDarkRGB(0xE3E6E0, 0xFFFFC5, 0x333333, 0x222222);
[UINavigationBar appearance].titleTextAttributes = @{NSForegroundColorAttributeName : UIColorFromLightSepiaMediumDarkRGB(0x8F918B, 0x8F918B, 0x8F918B, 0x8F918B)};
[UIToolbar appearance].barTintColor = UIColorFromLightSepiaMediumDarkRGB(0xE3E6E0, 0xFFFFC5, 0x4A4A4A, 0x222222);
[UISegmentedControl appearance].tintColor = UIColorFromLightSepiaMediumDarkRGB(0x8F918B, 0x8F918B, 0x8F918B, 0x8F918B);
Expand Down
4 changes: 2 additions & 2 deletions clients/ios/static/storyDetailViewDark.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

body {
color: #aaaaaa;
background-color: #202020;
background-color: #000000;
}

/* ========== */
Expand All @@ -17,7 +17,7 @@ body {

.NB-header {
color: #bbbbbb;
background-image: -webkit-gradient(linear, left top, left bottom, from(#444444), to(#222222));
background-image: -webkit-gradient(linear, left top, left bottom, from(#333333), to(#111111));
border-bottom: 1px solid #333532;
text-shadow: 0 1px 0 rgba(28, 28, 28, .1);

Expand Down
4 changes: 2 additions & 2 deletions clients/ios/static/storyDetailViewMedium.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

body {
color: #eeeeee;
background-color: gray;
background-color: #444444;
}

/* ========== */
Expand All @@ -17,7 +17,7 @@ body {

.NB-header {
color: #bbbbbb;
background-image: -webkit-gradient(linear, left top, left bottom, from(#777777), to(#606060));
background-image: -webkit-gradient(linear, left top, left bottom, from(#606060), to(#404040));
border-bottom: 1px solid #535353;
text-shadow: 0 1px 0 rgba(28, 28, 28, .1);

Expand Down

0 comments on commit 1692e58

Please sign in to comment.