iOS: Using CGColorRef to use an RGB color to add drop shadow
//CGColorRef pixelColor = [[UIColor redColor] CGColor];
// UIColor* color = [UIColor colorWithCGColor:pixelColor];
CGColorRef* aqua = [UIColor colorWithRed:0.521569 green:0.768627 blue:0.254902 alpha:1] CGColor];
layer.masksToBounds = NO;
layer.shadowRadius = 1.0f;
layer.shadowOpacity = 0.5f;
layer.shadowColor = aqua; // (__bridge CGColorRef)([UIColor grayColor]); // use bridge when it's not a CGColorRef type
layer.shadowOffset = CGSizeMake( 4.0f, 5.0f);
layer.shouldRasterize = YES;
layer.borderWidth = 0.8;
Comments
Post a Comment