我在别的地方看到这样一句话
CALayer sits at a lower technical level than UIButton, which means it doesn't understand what a UIColor is. UIButton knows what a UIColor is because they are both at the same technical level, but CALayer is below UIButton, so UIColor is a mystery.
CGColor存在于较为底层的CoreGraphics框架中,它是一个结构体
UIColor存在于相对CoreGraphics框架较高的UIKit框架中,他是一个类
CoreGraphics框架是可以跨平台使用的,UIKit框架仅限于iOS
为了保证移植性以及框架的统一性,不能互用