Created
January 17, 2012 13:05
-
-
Save arnaudbos/1626567 to your computer and use it in GitHub Desktop.
Set gradient color in Objective-C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
theView.backgroundColor = [UIColor clearColor]; | |
CAGradientLayer *layer = (CAGradientLayer *)theView.layer; | |
CGColorRef liteColor = [UIColor colorWithWhite:0.92f alpha:0.8f].CGColor; | |
CGColorRef darkColor = [UIColor colorWithWhite:0.32f alpha:0.8f].CGColor; | |
layer.colors = [NSArray arrayWithObjects:(id)liteColor, (id)darkColor, nil]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment