I am having trouble understanding the way CGContextDrawLinearGradient graphs the x and y points in order to create the ‘bounds’ of the gradient colors.
For example to create the proper gradient in the gold challenge:
center.x = rect.origin.x + rect.size.width /2;
center.y = rect.origin.y + rect.size.height /2;
top.x = rect.origin.x + rect.size.width /2;
top.y = rect.origin.y;
Center (50, 50)
Top (50, 0)
If you graph these two points the ‘top’ doesn’t rise on a graph at all, when the center is up and over?
When I change these values to experiment I don’t understand the changes to the gradient at all. I’ve had my fair share of college math courses, but maybe i’m just out of it…