2

I am trying to animate a button with some glow effect.

So far this is what I got:

self.glowLayer = [[CALayer alloc] init];
self.glowLayer.contents = (__bridge id _Nullable)(self.currentBackgroundImage.CGImage);
self.glowLayer.opacity = 0; // set to 1 with animation.
self.glowLayer.shadowColor = [UIColor vtoPinkColor].CGColor;
self.glowLayer.shadowOffset = CGSizeZero;
self.glowLayer.shadowRadius = 5;
self.glowLayer.shadowOpacity = 1;
self.glowLayer.rasterizationScale = [UIScreen mainScreen].scale;
self.glowLayer.shouldRasterize = YES;
[self.layer addSublayer:self.glowLayer];

However, I find the glow effect not strong enough. Of course I can change the shadow radius to make it wider but it only makes the shadow "dilute" instead of getting stronger.

enter image description here

How should I proceed ?

Antzi
  • 12,831
  • 7
  • 48
  • 74
  • 1
    What is `[UIColor vtoPinkColor]`? Is it partially transparent already? Is your content image partially transparent in the interior of the heart shape? Try using a fully opaque shadow color and an image where the shadow-casting parts are also fully opaque. – Ken Thomases Apr 19 '17 at 07:17
  • Also try a shadow color that's "darker" (has the same hue but reduced brightness). – Ken Thomases Apr 19 '17 at 07:23
  • No; this color does not contains transparency (same as heart) – Antzi Apr 19 '17 at 07:23

1 Answers1

0

changing the value of self.glowLayer.shadowOpacity 1 will work for you. and also try Translucent = No

Apurv Mahesh
  • 129
  • 4