Merge branch 'charlesmchen/newGrayscalePalette'

pull/1/head
Matthew Chen 7 years ago
commit 562d516a78

@ -116,7 +116,7 @@ NS_ASSUME_NONNULL_BEGIN
UILabel *fileTypeLabel = [UILabel new]; UILabel *fileTypeLabel = [UILabel new];
fileTypeLabel.text = fileExtension.localizedUppercaseString; fileTypeLabel.text = fileExtension.localizedUppercaseString;
fileTypeLabel.textColor = [UIColor ows_light90Color]; fileTypeLabel.textColor = [UIColor ows_gray90Color];
fileTypeLabel.lineBreakMode = NSLineBreakByTruncatingTail; fileTypeLabel.lineBreakMode = NSLineBreakByTruncatingTail;
fileTypeLabel.font = [UIFont ows_dynamicTypeCaption1Font].ows_mediumWeight; fileTypeLabel.font = [UIFont ows_dynamicTypeCaption1Font].ows_mediumWeight;
fileTypeLabel.adjustsFontSizeToFitWidth = YES; fileTypeLabel.adjustsFontSizeToFitWidth = YES;

@ -27,7 +27,7 @@ NS_ASSUME_NONNULL_BEGIN
self.delegate = self; self.delegate = self;
self.backgroundColor = (Theme.isDarkThemeEnabled ? UIColor.ows_dark85Color : UIColor.ows_light02Color); self.backgroundColor = (Theme.isDarkThemeEnabled ? UIColor.ows_gray90Color : UIColor.ows_gray02Color);
self.layer.borderColor self.layer.borderColor
= (Theme.isDarkThemeEnabled ? [Theme.primaryColor colorWithAlphaComponent:0.06f].CGColor = (Theme.isDarkThemeEnabled ? [Theme.primaryColor colorWithAlphaComponent:0.06f].CGColor
: [Theme.primaryColor colorWithAlphaComponent:0.12f].CGColor); : [Theme.primaryColor colorWithAlphaComponent:0.12f].CGColor);

@ -270,7 +270,7 @@ NS_ASSUME_NONNULL_BEGIN
UIImage *_Nullable statusIndicatorImage = nil; UIImage *_Nullable statusIndicatorImage = nil;
// TODO: Theme, Review with design. // TODO: Theme, Review with design.
UIColor *messageStatusViewTintColor UIColor *messageStatusViewTintColor
= (Theme.isDarkThemeEnabled ? [UIColor ows_dark30Color] : [UIColor ows_light35Color]); = (Theme.isDarkThemeEnabled ? [UIColor ows_gray25Color] : [UIColor ows_gray45Color]);
BOOL shouldAnimateStatusIcon = NO; BOOL shouldAnimateStatusIcon = NO;
if ([self.thread.lastMessageForInbox isKindOfClass:[TSOutgoingMessage class]]) { if ([self.thread.lastMessageForInbox isKindOfClass:[TSOutgoingMessage class]]) {
TSOutgoingMessage *outgoingMessage = (TSOutgoingMessage *)self.thread.lastMessageForInbox; TSOutgoingMessage *outgoingMessage = (TSOutgoingMessage *)self.thread.lastMessageForInbox;

@ -290,8 +290,8 @@ class MenuActionSheetView: UIView, MenuActionViewDelegate {
super.init(frame: frame) super.init(frame: frame)
backgroundColor = (Theme.isDarkThemeEnabled backgroundColor = (Theme.isDarkThemeEnabled
? UIColor.ows_dark85 ? UIColor.ows_gray90
: UIColor.ows_light10) : UIColor.ows_gray05)
addSubview(actionStackView) addSubview(actionStackView)
actionStackView.autoPinEdgesToSuperviewEdges() actionStackView.autoPinEdgesToSuperviewEdges()
@ -421,7 +421,7 @@ class MenuActionView: UIButton {
} }
let imageView = UIImageView(image: image) let imageView = UIImageView(image: image)
if Theme.isDarkThemeEnabled { if Theme.isDarkThemeEnabled {
imageView.tintColor = UIColor.ows_dark30 imageView.tintColor = UIColor.ows_gray25
} }
let imageWidth: CGFloat = 24 let imageWidth: CGFloat = 24
imageView.autoSetDimensions(to: CGSize(width: imageWidth, height: imageWidth)) imageView.autoSetDimensions(to: CGSize(width: imageWidth, height: imageWidth))
@ -436,7 +436,7 @@ class MenuActionView: UIButton {
let subtitleLabel = UILabel() let subtitleLabel = UILabel()
subtitleLabel.font = UIFont.ows_dynamicTypeSubheadline subtitleLabel.font = UIFont.ows_dynamicTypeSubheadline
subtitleLabel.textColor = (Theme.isDarkThemeEnabled subtitleLabel.textColor = (Theme.isDarkThemeEnabled
? UIColor.ows_dark30 ? UIColor.ows_gray25
: Theme.secondaryColor) : Theme.secondaryColor)
subtitleLabel.text = action.subtitle subtitleLabel.text = action.subtitle
subtitleLabel.isUserInteractionEnabled = false subtitleLabel.isUserInteractionEnabled = false
@ -463,14 +463,14 @@ class MenuActionView: UIButton {
private var defaultBackgroundColor: UIColor { private var defaultBackgroundColor: UIColor {
return (Theme.isDarkThemeEnabled return (Theme.isDarkThemeEnabled
? UIColor.ows_dark60 ? UIColor.ows_gray75
: UIColor.white) : UIColor.white)
} }
private var highlightedBackgroundColor: UIColor { private var highlightedBackgroundColor: UIColor {
return (Theme.isDarkThemeEnabled return (Theme.isDarkThemeEnabled
? UIColor.ows_dark70 ? UIColor.ows_gray75
: UIColor.ows_light10) : UIColor.ows_gray05)
} }
override var isHighlighted: Bool { override var isHighlighted: Bool {

@ -532,7 +532,7 @@ class CaptioningToolbar: UIView, UITextViewDelegate {
textView.delegate = self textView.delegate = self
textView.keyboardAppearance = Theme.keyboardAppearance textView.keyboardAppearance = Theme.keyboardAppearance
textView.backgroundColor = (Theme.isDarkThemeEnabled ? UIColor.ows_dark85 : UIColor.ows_light02) textView.backgroundColor = (Theme.isDarkThemeEnabled ? UIColor.ows_gray90 : UIColor.ows_gray02)
textView.layer.borderColor = (Theme.isDarkThemeEnabled textView.layer.borderColor = (Theme.isDarkThemeEnabled
? Theme.primaryColor.withAlphaComponent(0.06).cgColor ? Theme.primaryColor.withAlphaComponent(0.06).cgColor
: Theme.primaryColor.withAlphaComponent(0.12).cgColor) : Theme.primaryColor.withAlphaComponent(0.12).cgColor)

@ -6,7 +6,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
//#define THEME_ENABLED #define THEME_ENABLED
extern NSString *const ThemeDidChangeNotification; extern NSString *const ThemeDidChangeNotification;

@ -49,7 +49,7 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
+ (UIColor *)backgroundColor + (UIColor *)backgroundColor
{ {
return (Theme.isDarkThemeEnabled ? UIColor.ows_blackColor : UIColor.ows_whiteColor); return (Theme.isDarkThemeEnabled ? UIColor.ows_gray95Color : UIColor.ows_whiteColor);
} }
+ (UIColor *)offBackgroundColor + (UIColor *)offBackgroundColor
@ -60,34 +60,32 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
+ (UIColor *)primaryColor + (UIColor *)primaryColor
{ {
return (Theme.isDarkThemeEnabled ? UIColor.ows_dark05Color : UIColor.ows_light90Color); return (Theme.isDarkThemeEnabled ? UIColor.ows_gray05Color : UIColor.ows_gray90Color);
} }
+ (UIColor *)secondaryColor + (UIColor *)secondaryColor
{ {
return (Theme.isDarkThemeEnabled ? UIColor.ows_dark30Color : UIColor.ows_light60Color); return (Theme.isDarkThemeEnabled ? UIColor.ows_gray25Color : UIColor.ows_gray60Color);
} }
+ (UIColor *)boldColor + (UIColor *)boldColor
{ {
// TODO: Review with design.
return (Theme.isDarkThemeEnabled ? UIColor.ows_whiteColor : UIColor.blackColor); return (Theme.isDarkThemeEnabled ? UIColor.ows_whiteColor : UIColor.blackColor);
} }
+ (UIColor *)middleGrayColor + (UIColor *)middleGrayColor
{ {
// TODO: Review with design.
return [UIColor colorWithWhite:0.5f alpha:1.f]; return [UIColor colorWithWhite:0.5f alpha:1.f];
} }
+ (UIColor *)placeholderColor + (UIColor *)placeholderColor
{ {
return (Theme.isDarkThemeEnabled ? UIColor.ows_dark55Color : UIColor.ows_light35Color); return (Theme.isDarkThemeEnabled ? UIColor.ows_gray45Color : UIColor.ows_gray45Color);
} }
+ (UIColor *)hairlineColor + (UIColor *)hairlineColor
{ {
return (Theme.isDarkThemeEnabled ? UIColor.ows_dark60Color : UIColor.ows_light45Color); return (Theme.isDarkThemeEnabled ? UIColor.ows_gray75Color : UIColor.ows_gray25Color);
} }
#pragma mark - Global App Colors #pragma mark - Global App Colors
@ -99,8 +97,7 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
+ (UIColor *)navbarIconColor + (UIColor *)navbarIconColor
{ {
// TODO: Theme, Review with design. return (Theme.isDarkThemeEnabled ? UIColor.ows_gray25Color : UIColor.ows_gray60Color);
return (Theme.isDarkThemeEnabled ? UIColor.ows_dark60Color : UIColor.ows_light60Color);
} }
+ (UIColor *)navbarTitleColor + (UIColor *)navbarTitleColor
@ -125,7 +122,7 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
+ (UIColor *)conversationButtonBackgroundColor + (UIColor *)conversationButtonBackgroundColor
{ {
return (Theme.isDarkThemeEnabled ? [UIColor colorWithWhite:0.35f alpha:1.f] : UIColor.ows_light02Color); return (Theme.isDarkThemeEnabled ? [UIColor colorWithWhite:0.35f alpha:1.f] : UIColor.ows_gray02Color);
} }
+ (UIBlurEffect *)barBlurEffect + (UIBlurEffect *)barBlurEffect
@ -148,7 +145,7 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
+ (UIColor *)searchFieldBackgroundColor + (UIColor *)searchFieldBackgroundColor
{ {
return Theme.isDarkThemeEnabled ? Theme.offBackgroundColor : UIColor.ows_light10Color; return Theme.isDarkThemeEnabled ? Theme.offBackgroundColor : UIColor.ows_gray05Color;
} }
#pragma mark - #pragma mark -
@ -160,7 +157,7 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
+ (UIColor *)toastBackgroundColor + (UIColor *)toastBackgroundColor
{ {
return (Theme.isDarkThemeEnabled ? UIColor.ows_dark60Color : UIColor.ows_light60Color); return (Theme.isDarkThemeEnabled ? UIColor.ows_gray75Color : UIColor.ows_gray60Color);
} }
@end @end

@ -45,21 +45,22 @@ NS_ASSUME_NONNULL_BEGIN
@property (class, readonly, nonatomic) UIColor *ows_signalBlueColor; @property (class, readonly, nonatomic) UIColor *ows_signalBlueColor;
@property (class, readonly, nonatomic) UIColor *ows_greenColor; @property (class, readonly, nonatomic) UIColor *ows_greenColor;
@property (class, readonly, nonatomic) UIColor *ows_redColor; @property (class, readonly, nonatomic) UIColor *ows_redColor;
#pragma mark - GreyScale
@property (class, readonly, nonatomic) UIColor *ows_whiteColor; @property (class, readonly, nonatomic) UIColor *ows_whiteColor;
@property (class, readonly, nonatomic) UIColor *ows_light02Color; @property (class, readonly, nonatomic) UIColor *ows_gray02Color;
@property (class, readonly, nonatomic) UIColor *ows_light10Color; @property (class, readonly, nonatomic) UIColor *ows_gray05Color;
@property (class, readonly, nonatomic) UIColor *ows_light35Color; @property (class, readonly, nonatomic) UIColor *ows_gray25Color;
@property (class, readonly, nonatomic) UIColor *ows_light45Color; @property (class, readonly, nonatomic) UIColor *ows_gray45Color;
@property (class, readonly, nonatomic) UIColor *ows_light60Color; @property (class, readonly, nonatomic) UIColor *ows_gray60Color;
@property (class, readonly, nonatomic) UIColor *ows_light90Color; @property (class, readonly, nonatomic) UIColor *ows_gray75Color;
@property (class, readonly, nonatomic) UIColor *ows_dark05Color; @property (class, readonly, nonatomic) UIColor *ows_gray90Color;
@property (class, readonly, nonatomic) UIColor *ows_dark30Color; @property (class, readonly, nonatomic) UIColor *ows_gray95Color;
@property (class, readonly, nonatomic) UIColor *ows_dark55Color;
@property (class, readonly, nonatomic) UIColor *ows_dark60Color;
@property (class, readonly, nonatomic) UIColor *ows_dark70Color;
@property (class, readonly, nonatomic) UIColor *ows_dark85Color;
@property (class, readonly, nonatomic) UIColor *ows_dark95Color;
@property (class, readonly, nonatomic) UIColor *ows_blackColor; @property (class, readonly, nonatomic) UIColor *ows_blackColor;
#pragma mark - Conversation Colors
@property (class, readonly, nonatomic) UIColor *ows_red700Color; @property (class, readonly, nonatomic) UIColor *ows_red700Color;
@property (class, readonly, nonatomic) UIColor *ows_pink600Color; @property (class, readonly, nonatomic) UIColor *ows_pink600Color;
@property (class, readonly, nonatomic) UIColor *ows_purple600Color; @property (class, readonly, nonatomic) UIColor *ows_purple600Color;

@ -2,8 +2,8 @@
// Copyright (c) 2018 Open Whisper Systems. All rights reserved. // Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// //
#import "OWSMath.h"
#import "UIColor+OWS.h" #import "UIColor+OWS.h"
#import "OWSMath.h"
#import <SignalServiceKit/Cryptography.h> #import <SignalServiceKit/Cryptography.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@ -142,74 +142,51 @@ NS_ASSUME_NONNULL_BEGIN
return [UIColor colorWithRGBHex:0xf44336]; return [UIColor colorWithRGBHex:0xf44336];
} }
#pragma mark - GreyScale
+ (UIColor *)ows_whiteColor + (UIColor *)ows_whiteColor
{ {
return [UIColor colorWithRGBHex:0xFFFFFF]; return [UIColor colorWithRGBHex:0xFFFFFF];
} }
+ (UIColor *)ows_light02Color + (UIColor *)ows_gray02Color
{ {
return [UIColor colorWithRGBHex:0xF9FAFA]; return [UIColor colorWithRGBHex:0xF8F9F9];
} }
+ (UIColor *)ows_light10Color + (UIColor *)ows_gray05Color
{ {
return [UIColor colorWithRGBHex:0xEEEFEF]; return [UIColor colorWithRGBHex:0xEEEFEF];
} }
+ (UIColor *)ows_light35Color + (UIColor *)ows_gray25Color
{
return [UIColor colorWithRGBHex:0xA4A6A9];
}
+ (UIColor *)ows_light45Color
{ {
return [UIColor colorWithRGBHex:0x8B8E91]; return [UIColor colorWithRGBHex:0xBBBDBE];
} }
+ (UIColor *)ows_light60Color + (UIColor *)ows_gray45Color
{ {
return [UIColor colorWithRGBHex:0x62656A]; return [UIColor colorWithRGBHex:0x898A8C];
} }
+ (UIColor *)ows_light90Color + (UIColor *)ows_gray60Color
{ {
return [UIColor colorWithRGBHex:0x070C14]; return [UIColor colorWithRGBHex:0x636467];
} }
+ (UIColor *)ows_dark05Color + (UIColor *)ows_gray75Color
{ {
return [UIColor colorWithRGBHex:0xEFEFEF]; return [UIColor colorWithRGBHex:0x3D3E44];
} }
+ (UIColor *)ows_dark30Color + (UIColor *)ows_gray90Color
{ {
return [UIColor colorWithRGBHex:0xA8A9AA]; return [UIColor colorWithRGBHex:0x17191D];
} }
+ (UIColor *)ows_dark55Color + (UIColor *)ows_gray95Color
{ {
return [UIColor colorWithRGBHex:0x88898C]; return [UIColor colorWithRGBHex:0x0F1012];
}
+ (UIColor *)ows_dark60Color
{
return [UIColor colorWithRGBHex:0x797A7C];
}
+ (UIColor *)ows_dark70Color
{
return [UIColor colorWithRGBHex:0x414347];
}
+ (UIColor *)ows_dark85Color
{
return [UIColor colorWithRGBHex:0x1A1C20];
}
+ (UIColor *)ows_dark95Color
{
return [UIColor colorWithRGBHex:0x0A0C11];
} }
+ (UIColor *)ows_blackColor + (UIColor *)ows_blackColor
@ -217,6 +194,8 @@ NS_ASSUME_NONNULL_BEGIN
return [UIColor colorWithRGBHex:0x000000]; return [UIColor colorWithRGBHex:0x000000];
} }
#pragma mark - Conversation Colors
+ (UIColor *)ows_red700Color + (UIColor *)ows_red700Color
{ {
return [UIColor colorWithRGBHex:0xd32f2f]; return [UIColor colorWithRGBHex:0xd32f2f];

@ -145,7 +145,7 @@ public class ConversationStyle: NSObject {
@objc @objc
private static var defaultBubbleColorIncoming: UIColor { private static var defaultBubbleColorIncoming: UIColor {
return Theme.isDarkThemeEnabled ? UIColor.ows_dark70 : UIColor.ows_messageBubbleLightGray return Theme.isDarkThemeEnabled ? UIColor.ows_gray75 : UIColor.ows_messageBubbleLightGray
} }
@objc @objc
@ -158,7 +158,7 @@ public class ConversationStyle: NSObject {
public let bubbleColorOutgoingSent = UIColor.ows_darkSkyBlue public let bubbleColorOutgoingSent = UIColor.ows_darkSkyBlue
@objc @objc
public let dateBreakTextColor = UIColor.ows_light60 public let dateBreakTextColor = UIColor.ows_gray60
@objc @objc
public var primaryColor: UIColor public var primaryColor: UIColor
@ -193,7 +193,7 @@ public class ConversationStyle: NSObject {
@objc @objc
public static var bubbleTextColorIncoming: UIColor { public static var bubbleTextColorIncoming: UIColor {
return Theme.isDarkThemeEnabled ? UIColor.ows_white : UIColor.ows_light90 return Theme.isDarkThemeEnabled ? UIColor.ows_white : UIColor.ows_gray90
} }
@objc @objc
@ -254,12 +254,12 @@ public class ConversationStyle: NSObject {
@objc @objc
public func quotedReplyAuthorColor() -> UIColor { public func quotedReplyAuthorColor() -> UIColor {
return UIColor.ows_light90 return UIColor.ows_gray90
} }
@objc @objc
public func quotedReplyTextColor() -> UIColor { public func quotedReplyTextColor() -> UIColor {
return UIColor.ows_light90 return UIColor.ows_gray90
} }
@objc @objc

Loading…
Cancel
Save