Skip to content

Instantly share code, notes, and snippets.

@j4johnfox
Created April 27, 2010 23:42
Show Gist options
  • Save j4johnfox/381509 to your computer and use it in GitHub Desktop.
Save j4johnfox/381509 to your computer and use it in GitHub Desktop.
- (void)drawRect:(CGRect)aRect
{
log('here in MMSGradientView drawRect');
var myContext = [[CPGraphicsContext currentContext] graphicsPort];
var myGradient = CGGradientCreateWithColorComponents(CGColorSpaceCreateDeviceRGB(), [1, 1, 1,1.0, .5, .5, .5,1.0], [0,1], 2);
var startPoint = CGPointMake(0, 0);
var endPoint = CGPointMake(0, [self bounds].size.height);
CGContextDrawLinearGradient(myContext, myGradient, startPoint, endPoint, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment