Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CGColorSpaceRef rgbColorspace = CGColorSpaceCreateDeviceRGB();
- CGFloat values[4] = {1.0, 0.0, 0.0, 1.0};
- CGColorRef red = CGColorCreate(rgbColorspace, values);
- CGColorSpaceRelease(rgbColorspace);
- CABasicAnimation *selectionAnimation = [CABasicAnimation animationWithKeyPath:@"backgroundColor"];
- [selectionAnimation setDuration:0.5f];
- [selectionAnimation setToValue:[NSValue valueWithPointer:red]];
- [layer addAnimation:selectionAnimation forKey:@"selectionAnimation"];
- CABasicAnimation* selectionAnimation = [CABasicAnimation
- animationWithKeyPath:@"backgroundColor"];
- selectionAnimation.toValue = (id)[UIColor redColor].CGColor;
- [self.view.layer addAnimation:selectionAnimation
- forKey:@"selectionAnimation"];
- CABasicAnimation *ba = nil;
- ba = [CABasicAnimation animationWithKeyPath: kBackgroundColor];
- self.paleRedColor = [UIColor colorWithRed: 127.0f/255.0f green: 0.0f blue: 0.0f alpha: 1.0f];
- ba.toValue = (id) paleRedColor.CGColor;
- ba.repeatCount = 1;
- ba.autoreverses = YES;
- ba.duration = kDuration*2;
- [self.view.layer addAnimation: ba forKey: @"flashColor"];
Add Comment
Please, Sign In to add comment