|
|
|
@ -2,12 +2,17 @@
|
|
|
|
|
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#import "UIColor+OWS.h"
|
|
|
|
|
#import "OWSMath.h"
|
|
|
|
|
#import "UIColor+OWS.h"
|
|
|
|
|
#import <SignalServiceKit/Cryptography.h>
|
|
|
|
|
#import <SignalServiceKit/OWSPrimaryStorage.h>
|
|
|
|
|
#import <SignalServiceKit/YapDatabaseConnection+OWS.h>
|
|
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
|
|
NSString *const UIColorCollection = @"UIColorCollection";
|
|
|
|
|
NSString *const UIColorKeyThemeEnabled = @"UIColorKeyThemeEnabled";
|
|
|
|
|
|
|
|
|
|
@implementation UIColor (OWS)
|
|
|
|
|
|
|
|
|
|
#pragma mark - Global App Colors
|
|
|
|
@ -338,6 +343,26 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
return [self.ows_conversationColorMap allKeysForObject:color].firstObject;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma mark - Theme
|
|
|
|
|
|
|
|
|
|
+ (BOOL)isThemeEnabled
|
|
|
|
|
{
|
|
|
|
|
OWSAssertIsOnMainThread();
|
|
|
|
|
|
|
|
|
|
return [OWSPrimaryStorage.sharedManager.dbReadConnection boolForKey:UIColorKeyThemeEnabled
|
|
|
|
|
inCollection:UIColorCollection
|
|
|
|
|
defaultValue:NO];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+ (void)setIsThemeEnabled:(BOOL)value
|
|
|
|
|
{
|
|
|
|
|
OWSAssertIsOnMainThread();
|
|
|
|
|
|
|
|
|
|
[OWSPrimaryStorage.sharedManager.dbReadWriteConnection setBool:value
|
|
|
|
|
forKey:UIColorKeyThemeEnabled
|
|
|
|
|
inCollection:UIColorCollection];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|
|
|
|
|