有一个int值:RGB = 4294967295;
。怎么样从这个值中设置color?在C++中使用setRGB()方法。在IOS中有没有类似的实现方法?
谢谢高手指教。
有一个int值:RGB = 4294967295;
。怎么样从这个值中设置color?在C++中使用setRGB()方法。在IOS中有没有类似的实现方法?
谢谢高手指教。
试试:
float alpha = (intARGB >> 24) % 256;
float red = (intARGB >> 16) % 256;
float green = (intARGB >> 8) % 256;
float blue = intARGB % 256;
UIColor *theColor = [UIColor colorWithRed:red/255. green:green/255. blue:blue/255. alpha:alpha/255.];