171 lines
4.1 KiB
Objective-C
171 lines
4.1 KiB
Objective-C
|
|
|
|
// Created by YUMI on 2021/9/9.
|
|
|
|
|
|
#import "DJDKMIMOMColor.h"
|
|
|
|
@implementation DJDKMIMOMColor
|
|
|
|
+ (UIColor *)appMainColor {
|
|
return UIColorFromRGB(0x9682FF);
|
|
}
|
|
|
|
|
|
+ (UIColor *)appEmphasizeColor {
|
|
return UIColorFromRGB(0x248CFE);
|
|
}
|
|
|
|
|
|
+ (UIColor *)appEmphasizeColor1 {
|
|
return UIColorFromRGB(0xBF36FF);
|
|
}
|
|
|
|
|
|
+ (UIColor *)appEmphasizeColor2 {
|
|
return UIColorFromRGB(0xFB486A);
|
|
}
|
|
|
|
|
|
+ (UIColor *)appBackgroundColor {
|
|
return UIColorFromRGB(0xF3F5FA);
|
|
}
|
|
|
|
+ (UIColor *)appCellBackgroundColor {
|
|
return UIColorFromRGB(0xFFFFFF);
|
|
}
|
|
|
|
+ (UIColor *)mainTextColor {
|
|
return UIColorFromRGB(0x161958);
|
|
}
|
|
|
|
+ (UIColor *)secondTextColor {
|
|
return UIColorFromRGB(0x8A8CAB);
|
|
}
|
|
|
|
+ (UIColor *)textThirdColor {
|
|
return UIColorFromRGB(0xBABBCD);
|
|
}
|
|
|
|
+ (UIColor *)dividerColor {
|
|
return UIColorFromRGB(0xE8E8E8);
|
|
}
|
|
|
|
|
|
+ (UIColor *)confirmButtonGradientStartColor {
|
|
return UIColorFromRGB(0x13E2F5);
|
|
}
|
|
|
|
+ (UIColor *)confirmButtonGradientEndColor {
|
|
return UIColorFromRGB(0xCC66FF);
|
|
}
|
|
|
|
+ (UIColor *)confirmButtonTextColor {
|
|
return UIColorFromRGB(0xFFFFFF);
|
|
}
|
|
|
|
+ (UIColor *)cancelButtonGradientStartColor {
|
|
return UIColorFromRGB(0xCEEFFD);
|
|
}
|
|
|
|
|
|
+ (UIColor *)confirmButtonGradientMiddleColor {
|
|
return UIColorFromRGB(0xf9CB3FF);
|
|
}
|
|
|
|
+ (UIColor *)cancelButtonGradientEndColor {
|
|
return UIColorFromRGB(0xD2F4F4);
|
|
}
|
|
|
|
+ (UIColor *)cancelButtonTextColor {
|
|
return UIColorFromRGB(0x5FCCE4);
|
|
}
|
|
|
|
+ (UIColor *)cancelButtonNormalBgColor {
|
|
return UIColorFromRGB(0xCEEFFD);
|
|
}
|
|
|
|
+ (UIColor *)disableButtonColor {
|
|
return UIColorFromRGB(0xCEEFFD);
|
|
}
|
|
|
|
+ (UIColor *)disableButtonTextColor {
|
|
return UIColorFromRGB(0xB3B3C3);
|
|
}
|
|
|
|
|
|
+ (UIColor *)alertBackgroundColor {
|
|
return UIColorFromRGB(0xFFFFFF);
|
|
}
|
|
+ (UIColor *)alertTitleColor {
|
|
return UIColorFromRGB(0x333333);
|
|
}
|
|
+ (UIColor *)alertMessageColor {
|
|
return UIColorFromRGB(0x333333);
|
|
}
|
|
+ (UIColor *)actionSeparatorColor {
|
|
return UIColorFromRGB(0xF0F0F0);
|
|
}
|
|
|
|
|
|
+ (UIColor *)tabbarNormalColor {
|
|
return UIColorRGBAlpha(0x333333, 0.4);
|
|
}
|
|
|
|
+ (UIColor *)tabbarViewColor {
|
|
return UIColorFromRGB(0xFFFFFF);
|
|
}
|
|
|
|
+ (UIColor *)colorWithHexString: (NSString *) hexString {
|
|
if (hexString.length == 0) {
|
|
return [UIColor blackColor];
|
|
}
|
|
NSString *colorString = [[hexString stringByReplacingOccurrencesOfString: @"#" withString: @""] uppercaseString];
|
|
CGFloat alpha, red, blue, green;
|
|
switch ([colorString length]) {
|
|
case 3:
|
|
alpha = 1.0f;
|
|
red = [self colorComponentFrom: colorString start: 0 length: 1];
|
|
green = [self colorComponentFrom: colorString start: 1 length: 1];
|
|
blue = [self colorComponentFrom: colorString start: 2 length: 1];
|
|
break;
|
|
case 4:
|
|
alpha = [self colorComponentFrom: colorString start: 0 length: 1];
|
|
red = [self colorComponentFrom: colorString start: 1 length: 1];
|
|
green = [self colorComponentFrom: colorString start: 2 length: 1];
|
|
blue = [self colorComponentFrom: colorString start: 3 length: 1];
|
|
break;
|
|
case 6:
|
|
alpha = 1.0f;
|
|
red = [self colorComponentFrom: colorString start: 0 length: 2];
|
|
green = [self colorComponentFrom: colorString start: 2 length: 2];
|
|
blue = [self colorComponentFrom: colorString start: 4 length: 2];
|
|
break;
|
|
case 8:
|
|
alpha = [self colorComponentFrom: colorString start: 0 length: 2];
|
|
red = [self colorComponentFrom: colorString start: 2 length: 2];
|
|
green = [self colorComponentFrom: colorString start: 4 length: 2];
|
|
blue = [self colorComponentFrom: colorString start: 6 length: 2];
|
|
break;
|
|
default:
|
|
[NSException raise:@"Invalid color value" format: @"Color value %@ is invalid. It should be a hex value of the form #RBG, #ARGB, #RRGGBB, or #AARRGGBB", hexString];
|
|
break;
|
|
}
|
|
return [UIColor colorWithRed: red green: green blue: blue alpha: alpha];
|
|
}
|
|
|
|
+ (CGFloat) colorComponentFrom: (NSString *) string start: (NSUInteger) start length: (NSUInteger) length {
|
|
NSString *substring = [string substringWithRange: NSMakeRange(start, length)];
|
|
NSString *fullHex = length == 2 ? substring : [NSString stringWithFormat: @"%@%@", substring, substring];
|
|
unsigned hexComponent;
|
|
[[NSScanner scannerWithString: fullHex] scanHexInt: &hexComponent];
|
|
return hexComponent / 255.0;
|
|
}
|
|
|
|
|
|
+ (UIColor *)inputTextColor {
|
|
return [self colorWithHexString:@"#1F1A4E"];
|
|
}
|
|
|
|
@end
|