diff --git a/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.m b/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.m index 9706ac479..8cf20960e 100644 --- a/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.m +++ b/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.m @@ -291,7 +291,7 @@ AvatarImageView *avatarView = [[AvatarImageView alloc] initWithImage:avatarImage]; if (!localProfileAvatarImage) { - avatarView.tintColor = [UIColor colorWithRGBHex:0x888888]; + avatarView.tintColor = Theme.middleGrayColor; } [cell.contentView addSubview:avatarView]; [avatarView autoVCenterInSuperview]; diff --git a/Signal/src/ViewControllers/ConversationView/ConversationScrollButton.m b/Signal/src/ViewControllers/ConversationView/ConversationScrollButton.m index 4e551036d..2b6ba024f 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationScrollButton.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationScrollButton.m @@ -56,7 +56,7 @@ NS_ASSUME_NONNULL_BEGIN self.circleView = circleView; circleView.userInteractionEnabled = NO; circleView.layer.cornerRadius = circleSize * 0.5f; - circleView.layer.shadowColor = [UIColor colorWithWhite:0.5f alpha:1.f].CGColor; + circleView.layer.shadowColor = Theme.middleGrayColor.CGColor; circleView.layer.shadowOffset = CGSizeMake(+1.f, +2.f); circleView.layer.shadowRadius = 1.5f; circleView.layer.shadowOpacity = 0.35f; diff --git a/Signal/src/ViewControllers/ProfileViewController.m b/Signal/src/ViewControllers/ProfileViewController.m index be61a61cc..fc213acb2 100644 --- a/Signal/src/ViewControllers/ProfileViewController.m +++ b/Signal/src/ViewControllers/ProfileViewController.m @@ -491,7 +491,7 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat self.avatarView.image = (self.avatar ?: [[UIImage imageNamed:@"profile_avatar_default"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]); - self.avatarView.tintColor = (self.avatar ? nil : [UIColor colorWithRGBHex:0x888888]); + self.avatarView.tintColor = (self.avatar ? nil : Theme.middleGrayColor); self.cameraImageView.hidden = self.avatar != nil; } diff --git a/Signal/src/ViewControllers/Registration/RegistrationViewController.m b/Signal/src/ViewControllers/Registration/RegistrationViewController.m index f4609ffea..196ff9ae7 100644 --- a/Signal/src/ViewControllers/Registration/RegistrationViewController.m +++ b/Signal/src/ViewControllers/Registration/RegistrationViewController.m @@ -213,7 +213,7 @@ NSString *const kKeychainKey_LastRegisteredPhoneNumber = @"kKeychainKey_LastRegi UILabel *examplePhoneNumberLabel = [UILabel new]; self.examplePhoneNumberLabel = examplePhoneNumberLabel; examplePhoneNumberLabel.font = [UIFont ows_regularFontWithSize:fontSizePoints - 2.f]; - examplePhoneNumberLabel.textColor = [UIColor colorWithWhite:0.5f alpha:1.f]; + examplePhoneNumberLabel.textColor = Theme.middleGrayColor; [contentView addSubview:examplePhoneNumberLabel]; [examplePhoneNumberLabel autoPinTrailingToSuperviewMargin]; [examplePhoneNumberLabel autoPinEdge:ALEdgeTop diff --git a/SignalMessaging/ViewControllers/EditContactShareNameViewController.swift b/SignalMessaging/ViewControllers/EditContactShareNameViewController.swift index e70befa18..f755ac823 100644 --- a/SignalMessaging/ViewControllers/EditContactShareNameViewController.swift +++ b/SignalMessaging/ViewControllers/EditContactShareNameViewController.swift @@ -70,7 +70,7 @@ class ContactNameFieldView: UIView { valueView.text = initialValue } valueView.font = UIFont.ows_dynamicTypeBody - valueView.textColor = UIColor.black + valueView.textColor = Theme.primaryColor stackView.addArrangedSubview(valueView) valueView.addTarget(self, action: #selector(textFieldDidChange), for: .editingChanged) @@ -209,7 +209,7 @@ public class EditContactShareNameViewController: OWSViewController, ContactNameF comment: "Title for the 'edit contact share name' view.") self.view.preservesSuperviewLayoutMargins = false - self.view.backgroundColor = UIColor.white + self.view.backgroundColor = Theme.backgroundColor updateContent() diff --git a/SignalMessaging/ViewControllers/MessageApprovalViewController.swift b/SignalMessaging/ViewControllers/MessageApprovalViewController.swift index 938985cb1..e182e5c1a 100644 --- a/SignalMessaging/ViewControllers/MessageApprovalViewController.swift +++ b/SignalMessaging/ViewControllers/MessageApprovalViewController.swift @@ -74,7 +74,7 @@ public class MessageApprovalViewController: OWSViewController, UITextViewDelegat public override func loadView() { self.view = UIView.container() - self.view.backgroundColor = UIColor.white + self.view.backgroundColor = Theme.backgroundColor // Recipient Row let recipientRow = createRecipientRow() @@ -85,8 +85,8 @@ public class MessageApprovalViewController: OWSViewController, UITextViewDelegat // Text View textView = UITextView() textView.delegate = self - textView.backgroundColor = UIColor.white - textView.textColor = UIColor.black + textView.backgroundColor = Theme.backgroundColor + textView.textColor = Theme.primaryColor textView.font = UIFont.ows_dynamicTypeBody textView.text = self.initialMessageText textView.contentInset = UIEdgeInsets(top: 0.0, left: 0.0, bottom: 0.0, right: 0.0) @@ -103,7 +103,7 @@ public class MessageApprovalViewController: OWSViewController, UITextViewDelegat // Hairline borders should be 1 pixel, not 1 point. let borderThickness = 1.0 / UIScreen.main.scale - let borderColor = UIColor(white: 135 / 255.0, alpha: 1.0) + let borderColor = Theme.middleGrayColor let topBorder = UIView.container() topBorder.backgroundColor = borderColor @@ -128,12 +128,12 @@ public class MessageApprovalViewController: OWSViewController, UITextViewDelegat let toLabel = UILabel() toLabel.text = NSLocalizedString("MESSAGE_APPROVAL_RECIPIENT_LABEL", comment: "Label for the recipient name in the 'message approval' dialog.") - toLabel.textColor = UIColor.ows_darkGray + toLabel.textColor = Theme.secondaryColor toLabel.font = font recipientRow.addSubview(toLabel) let nameLabel = UILabel() - nameLabel.textColor = UIColor.black + nameLabel.textColor = Theme.primaryColor nameLabel.font = font nameLabel.lineBreakMode = .byTruncatingTail recipientRow.addSubview(nameLabel) @@ -165,12 +165,12 @@ public class MessageApprovalViewController: OWSViewController, UITextViewDelegat } nameLabel.attributedText = contactsManager.formattedFullName(forRecipientId: contactThread.contactIdentifier(), font: font) - nameLabel.textColor = UIColor.black + nameLabel.textColor = Theme.primaryColor if let profileName = self.profileName(contactThread: contactThread) { // If there's a profile name worth showing, add it as a second line below the name. let profileNameLabel = UILabel() - profileNameLabel.textColor = UIColor.ows_darkGray + profileNameLabel.textColor = Theme.secondaryColor profileNameLabel.font = font profileNameLabel.text = profileName profileNameLabel.lineBreakMode = .byTruncatingTail diff --git a/SignalMessaging/ViewControllers/ModalActivityIndicatorViewController.swift b/SignalMessaging/ViewControllers/ModalActivityIndicatorViewController.swift index 9e447d2ef..de47e54db 100644 --- a/SignalMessaging/ViewControllers/ModalActivityIndicatorViewController.swift +++ b/SignalMessaging/ViewControllers/ModalActivityIndicatorViewController.swift @@ -71,7 +71,7 @@ public class ModalActivityIndicatorViewController: OWSViewController { public override func loadView() { super.loadView() - self.view.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.25) + self.view.backgroundColor = UIColor(white: 0, alpha: 0.25) self.view.isOpaque = false let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: .whiteLarge) diff --git a/SignalMessaging/ViewControllers/OWSTableViewController.m b/SignalMessaging/ViewControllers/OWSTableViewController.m index 0fd53fedf..20656012a 100644 --- a/SignalMessaging/ViewControllers/OWSTableViewController.m +++ b/SignalMessaging/ViewControllers/OWSTableViewController.m @@ -289,7 +289,7 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f; cell.textLabel.font = [UIFont ows_regularFontWithSize:15.f]; // Soft color. // TODO: Theme, review with design. - cell.textLabel.textColor = [UIColor colorWithWhite:0.5f alpha:1.f]; + cell.textLabel.textColor = Theme.middleGrayColor; // Centered. cell.textLabel.textAlignment = NSTextAlignmentCenter; cell.userInteractionEnabled = NO; diff --git a/SignalMessaging/ViewControllers/SelectThreadViewController.m b/SignalMessaging/ViewControllers/SelectThreadViewController.m index 22ce20bcd..3fa5ec514 100644 --- a/SignalMessaging/ViewControllers/SelectThreadViewController.m +++ b/SignalMessaging/ViewControllers/SelectThreadViewController.m @@ -223,8 +223,7 @@ NS_ASSUME_NONNULL_BEGIN [[DisappearingTimerConfigurationView alloc] initWithDurationSeconds:disappearingMessagesConfiguration.durationSeconds]; - disappearingTimerConfigurationView.tintColor = - [UIColor colorWithWhite:0.5f alpha:1.f]; + disappearingTimerConfigurationView.tintColor = Theme.middleGrayColor; [disappearingTimerConfigurationView autoSetDimensionsToSize:CGSizeMake(44, 44)]; [cell ows_setAccessoryView:disappearingTimerConfigurationView]; diff --git a/SignalMessaging/Views/ContactCellView.m b/SignalMessaging/Views/ContactCellView.m index ec9b58441..e27b8a8d6 100644 --- a/SignalMessaging/Views/ContactCellView.m +++ b/SignalMessaging/Views/ContactCellView.m @@ -100,7 +100,7 @@ const CGFloat kContactCellAvatarTextMargin = 12; self.nameLabel.textColor = [Theme primaryColor]; self.profileNameLabel.textColor = [Theme secondaryColor]; self.subtitleLabel.textColor = [Theme secondaryColor]; - self.accessoryLabel.textColor = [UIColor colorWithWhite:0.5f alpha:1.f]; + self.accessoryLabel.textColor = Theme.middleGrayColor; } - (void)configureWithRecipientId:(NSString *)recipientId contactsManager:(OWSContactsManager *)contactsManager diff --git a/SignalMessaging/categories/Theme.h b/SignalMessaging/categories/Theme.h index fc6406b36..90ea5c1ac 100644 --- a/SignalMessaging/categories/Theme.h +++ b/SignalMessaging/categories/Theme.h @@ -27,6 +27,7 @@ extern NSString *const ThemeDidChangeNotification; @property (class, readonly, nonatomic) UIColor *secondaryColor; @property (class, readonly, nonatomic) UIColor *boldColor; @property (class, readonly, nonatomic) UIColor *offBackgroundColor; +@property (class, readonly, nonatomic) UIColor *middleGrayColor; #pragma mark - Global App Colors diff --git a/SignalMessaging/categories/Theme.m b/SignalMessaging/categories/Theme.m index ebd053ade..85ddc6760 100644 --- a/SignalMessaging/categories/Theme.m +++ b/SignalMessaging/categories/Theme.m @@ -78,6 +78,12 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled"; return (Theme.isDarkThemeEnabled ? UIColor.ows_whiteColor : UIColor.blackColor); } ++ (UIColor *)middleGrayColor +{ + // TODO: Review with design. + return [UIColor colorWithWhite:0.5f alpha:1.f]; +} + #pragma mark - Global App Colors + (UIColor *)navbarBackgroundColor diff --git a/SignalMessaging/utils/ConversationStyle.swift b/SignalMessaging/utils/ConversationStyle.swift index 7cbbdf311..989f08501 100644 --- a/SignalMessaging/utils/ConversationStyle.swift +++ b/SignalMessaging/utils/ConversationStyle.swift @@ -255,6 +255,6 @@ public class ConversationStyle: NSObject { @objc public func quotedReplyAttachmentColor() -> UIColor { // TODO: - return UIColor(white: 0.5, alpha: 1.0) + return Theme.middleGrayColor } }