如何将 UIColor 对象转换为 uint32_t 值。请让我知道是否有人知道这一点?
这是代码:
const CGFloat *components = CGColorGetComponents([UIColor redColor].CGColor);
CGFloat r = components[0];
CGFloat g = components[1];
CGFloat b = components[2];
const uint32_t rgb = ((uint32_t)r << 16 | (uint32_t)g << 8 | (uint32_t)b);
如何在 uint32_t 中传递 0xFFFFFFFF 值?
const uint32_t white = 0xFFFFFFFF, black = 0xFF000000, transp = 0x00FFFFFF;