#import "UIColor+Extension.h"
@implementation UIColor (Extension)
+(instancetype)lz_colorWithHex:(u_int32_t)hex
{
int red;
int green;
int blue;
//AAECDD
red=(hex & 0xFF000000) >> 16;
green=(hex & 0x00FF00) >> 8;
blue=hex & 0x0000FF;
return [UIColor colorWithRed:red/255.0 green:green/255.0 blue:blue/255.0 alpha:1.0];
}
@end
将十六进制色值转成RGB
最新推荐文章于 2023-05-15 14:43:07 发布