通过Core Library的文档,我们知道创建颜色有这么几个方法: CGColorCreate
CGColorCreateCopy
CGColorCreateGenericGray
CGColorCreateGenericRGB
CGColorCreateGenericCMYK
CGColorCreateCopyWithAlpha
CGColorCreateWithPattern 再来看一下CGColorCreate:
CGColorRef CGColorCreate (
CGColorSpaceRef colorspace,
const CGFloat components[]
https://opensource.apple.com/source/CF/CF-855.17/CFRunLoop.c
关于 bitmap and colorspace 很不错