//
//  CALayer+DDCategory.h
//  DDCategoryKit_Private
//  Created by DDIsFriend on 2022/7/29.

#import <QuartzCore/QuartzCore.h>

NS_ASSUME_NONNULL_BEGIN

@interface CALayer (DDCategory)
/**
 *give the layer shadow
 *@param shadowColor layer shadowColor
 *@param shadowOffset layer shadowOffset
 *@param shadowRadius layer shadowRadius
 *@param shadowOpacity layer shadowOpacity
 *@param layerBackground you must set layerBackground,otherwise shadow can not be show.
 *@warning this function maybe effect fps, you should set rasterize to reduce impact. and you can set shadowPath to reduce consumption of cpu. the layerBackground must be setted.
 */
+ (CALayer *)dd_layerWithShadowColor:(CGColorRef)shadowColor shadowOffset:(CGSize)shadowOffset shadowRadius:(CGFloat)shadowRadius shadowOpacity:(CGFloat)shadowOpacity  cornerRadius:(CGFloat)cornerRadius layerBackground:(nullable CGColorRef)layerBackground;
/**
 *the view transfer this function must already has setted background.
 */
- (void)dd_layerWithShadowColor:(CGColorRef)shadowColor shadowOffset:(CGSize)shadowOffset shadowRadius:(CGFloat)shadowRadius shadowOpacity:(CGFloat)shadowOpacity  cornerRadius:(CGFloat)cornerRadius layerBackground:(nullable CGColorRef)layerBackground;
@end

NS_ASSUME_NONNULL_END
