Color

深浅调整

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/**
颜色变深

@return 变深之后的颜色
*/
- (UIColor *)dark;

/**
颜色变浅

@return 变浅之后的颜色
*/
- (UIColor *)light;

/**
颜色变深,传入参数ratio为比例(0~1)
*/
- (UIColor *(^)(CGFloat ratio))darkRatio;

/**
颜色变浅,传入参数ratio为比例(0~1)
*/
- (UIColor *(^)(CGFloat ratio))lightRatio;

创建颜色

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/**
随机色

@return 随机色
*/
+ (UIColor *)randomColor;

/**
以HEX创建颜色

@param hex 16进制
@return UIColor实例
*/
+ (UIColor *)colorWithHex:(NSUInteger)hex;

/**
以HEX字符串创建颜色

@param hexStr HEX字符串
@return UIColor实例
*/
+ (UIColor *)colorWithHexString:(NSString *)hexStr;

解析

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
获取UIColor中的R值

@return R值(0~1)
*/
- (CGFloat)redValue;

/**
获取UIColor中的G值

@return R值(0~1)
*/
- (CGFloat)greenValue;

/**
获取UIColor中的B值

@return R值(0~1)
*/
- (CGFloat)blueValue;

/**
获取UIColor中的Alpha值

@return R值(0~1)
*/
- (CGFloat)alphaValue;


/**
获取颜色的HEX字符串(不含Alpha值)

@return HEX字符串
*/
- (NSString *)hexString;

/**
获取颜色的HEX字符串

@return HEX字符串
*/
- (NSString *)hexStringWithAlpha;

AXKit Color Pack

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/**
蓝色
*/
@property (class, strong, readonly, nonatomic) UIColor *ax_blue;

/**
青色
*/
@property (class, strong, readonly, nonatomic) UIColor *ax_cyan;

/**
绿色
*/
@property (class, strong, readonly, nonatomic) UIColor *ax_green;

/**
浅红色
*/
@property (class, strong, readonly, nonatomic) UIColor *ax_lightRed;

/**
红色
*/
@property (class, strong, readonly, nonatomic) UIColor *ax_red;

Material Design Color Pack

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma mark red -> purple
@property (class, strong, readonly, nonatomic) UIColor *md_red;
@property (class, strong, readonly, nonatomic) UIColor *md_pink;
@property (class, strong, readonly, nonatomic) UIColor *md_purple;
@property (class, strong, readonly, nonatomic) UIColor *md_deepPurple;

#pragma mark blue -> cyan
@property (class, strong, readonly, nonatomic) UIColor *md_indigo;
@property (class, strong, readonly, nonatomic) UIColor *md_blue;
@property (class, strong, readonly, nonatomic) UIColor *md_lightBlue;
@property (class, strong, readonly, nonatomic) UIColor *md_cyan;
@property (class, strong, readonly, nonatomic) UIColor *md_teal;

#pragma mark green -> yellow
@property (class, strong, readonly, nonatomic) UIColor *md_green;
@property (class, strong, readonly, nonatomic) UIColor *md_lightGreen;
@property (class, strong, readonly, nonatomic) UIColor *md_lime;
@property (class, strong, readonly, nonatomic) UIColor *md_yellow;
@property (class, strong, readonly, nonatomic) UIColor *md_amber;

#pragma mark orange -> gray
@property (class, strong, readonly, nonatomic) UIColor *md_orange;
@property (class, strong, readonly, nonatomic) UIColor *md_deepOrange;
@property (class, strong, readonly, nonatomic) UIColor *md_brown;
@property (class, strong, readonly, nonatomic) UIColor *md_blueGray;
@property (class, strong, readonly, nonatomic) UIColor *md_gray;



评论

有疑问请前往本项目的【Issue】页面搜索问题,如果没有相关问题,点击【New issue】进行提问。