UIColor之【扩展:#FFFFFF -UIColor】
生活随笔
收集整理的這篇文章主要介紹了
UIColor之【扩展:#FFFFFF -UIColor】
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
2019獨(dú)角獸企業(yè)重金招聘Python工程師標(biāo)準(zhǔn)>>>
+(UIColor*)colorWithHexString:(NSString *)hexColor{if ([hexColor length] == 7 && [hexColor hasPrefix:@"#"]) {unsigned int red, green, blue;NSRange range;range.length = 2;range.location = 1;[[NSScanner scannerWithString:[hexColor substringWithRange:range]]scanHexInt:&red];range.location = 3;[[NSScanner scannerWithString:[hexColor substringWithRange:range]]scanHexInt:&green];range.location = 5;[[NSScanner scannerWithString:[hexColor substringWithRange:range]]scanHexInt:&blue];return [UIColor colorWithRed:((float)red/255.0f) green:((float)green/255.0f) blue:((float)blue/255.0f) alpha:1.0f];}return [UIColor clearColor]; }轉(zhuǎn)載于:https://my.oschina.net/u/2462423/blog/507760
與50位技術(shù)專家面對面20年技術(shù)見證,附贈技術(shù)全景圖總結(jié)
以上是生活随笔為你收集整理的UIColor之【扩展:#FFFFFF -UIColor】的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux下定时任务不能执行
- 下一篇: MYSQL和ORACLE时区设置比较