开发者

Core-Graphics Shadow Range?

开发者 https://www.devze.com 2023-03-25 09:36 出处:网络
In Photoshop, my designer used the \"Range\" setting to get the outer glow to \"fill out\" a little more. Here is a snapshot of the settings he used:

In Photoshop, my designer used the "Range" setting to get the outer glow to "fill out" a little more. Here is a snapshot of the settings he used:

Core-Graphics Shadow Range?

With the range in Photoshop set to 100%, here is the look:

Core-Graphics Shadow Range?

That looks like my rendering on the iPhone using this code (assume the gradient fill and stroke around the circle are both working fine, we're only focusing on the glow):

CGContextAddPath(context, spectralImagePath);
CGContextSaveGState(context);
CGContextSetShado开发者_如何学CwWithColor(context, CGSizeMake(0.0, 0.0), 21.0, [[UIColor colorWithRed:65.0/255.0 green:79.0/255.0 blue:246.0/255.0 alpha:1.0] CGColor]);
CGContextSetBlendMode(context, kCGBlendModeScreen);
CGContextFillPath(context);
CGContextRestoreGState(context);

But, it needs to look like this (with range set to 50% in photoshop):

Core-Graphics Shadow Range?

Notice how the shadow is a little more dense around the edges of the circle. Any ideas if Core Graphics contains a range-like property?


I don’t know of one. As an alternative, you might try just drawing the same shadowed path multiple times via repeated calls to CGContextFillPath.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号