|
导读
1.带透明度的黑白色
[Objective-C] 纯文本查看 复制代码 kWhiteColor(0, 0.5)
第一个参数为0表示黑色,1表示白色
2.系统预设的颜色
[Objective-C] 纯文本查看 复制代码 @property(class, nonatomic, readonly) UIColor *blackColor; // 0.0 white
@property(class, nonatomic, readonly) UIColor *darkGrayColor; // 0.333 white
@property(class, nonatomic, readonly) UIColor *lightGrayColor; // 0.667 white
@property(class, nonatomic, readonly) UIColor *whiteColor; // 1.0 white
@property(class, nonatomic, readonly) UIColor *grayColor; // 0.5 white
@property(class, nonatomic, readonly) UIColor *redColor; // 1.0, 0.0, 0.0 RGB
@property(class, nonatomic, readonly) UIColor *greenColor; // 0.0, 1.0, 0.0 RGB
@property(class, nonatomic, readonly) UIColor *blueColor; // 0.0, 0.0, 1.0 RGB
@property(class, nonatomic, readonly) UIColor *cyanColor; // 0.0, 1.0, 1.0 RGB
@property(class, nonatomic, readonly) UIColor *yellowColor; // 1.0, 1.0, 0.0 RGB
@property(class, nonatomic, readonly) UIColor *magentaColor; // 1.0, 0.0, 1.0 RGB
@property(class, nonatomic, readonly) UIColor *orangeColor; // 1.0, 0.5, 0.0 RGB
@property(class, nonatomic, readonly) UIColor *purpleColor; // 0.5, 0.0, 0.5 RGB
@property(class, nonatomic, readonly) UIColor *brownColor; // 0.6, 0.4, 0.2 RGB
@property(class, nonatomic, readonly) UIColor *clearColor;
使用(直接传入后面的颜色名):
[Objective-C] 纯文本查看 复制代码 kColor(redColor);
3.使用十六进制颜色值
[C#] 纯文本查看 复制代码 kColorFromHex(@"fbb333");
4.rgb值
[Objective-C] 纯文本查看 复制代码 kColorFromRGB(255, 233, 140);
5.rgb值都相同的
[Objective-C] 纯文本查看 复制代码 kColorFromSameRGB(100); 等同于
kColorFromRGB(100, 100, 100);
框架源码下载
|
|