I am using 2 variations of the same color, a light and dark version, to create a gradient.
Code:
CAGradientLayer *gradient = [CAGradientLayer layer];
UIColor *light = [baseColor lightVersion];
UIColor *dark = [baseColor darkVersion];
gradient.colors = [NSArray arrayWithObjects:(id)[light CGColor], (id)[dark CGColor], nil];
The problem is, I noticed that the CGColor
version of the original UIColor
version is different. Why is that? What is the difference between the UIColor
and CGColor
and why are they different?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…