颜色的几种不同的宏定义
2015-07-22 11:22
302 查看
iOS
#define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]
#define RGB(r) [UIColor colorWithRed:(r)/255.0 green:(r)/255.0 blue:(r)/255.0 alpha:(1)]
///颜色值
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]
#define RGB(r) [UIColor colorWithRed:(r)/255.0 green:(r)/255.0 blue:(r)/255.0 alpha:(1)]
///颜色值
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
相关文章推荐
- POJ 3342 Party at Hali-Bula (树形dp 树的最大独立集 判多解 好题)
- Asp.net MVC Request Life Cycle
- Atitit.异步编程 java .net php python js 对照
- Crontab定时任务配置
- [转]Failed to run the WC DB work queue associated with 错误的解决
- c语言,指针与数组--指针与二维数组2
- ie浏览器前缀特殊符号的识别
- 关于ueditor在javaweb项目中的集成
- hdu 5294 Tricks Device(2015多校第一场第7题)最大流+最短路
- 再谈c的内存管理及指针问题
- ArcGIS教程:编辑特征
- ADO.NET数据库访问技术
- poj 2299 Ultra-QuickSort 二分+线段树求逆序数
- 快速理解Docker - 容器级虚拟化解决方案
- 杭电5285二分图染色和并查集
- C++ I/O库流状态标志位
- 矩形面积并 POJ Atlantis
- 杭电OJ-1036_Average is not Fast Enough!
- hihoCoder - 1176 - 欧拉路·一 (欧拉路的判定)
- ZOJ 1002