//
//  UIColor+StoryBoard.m
//  superCleaner
//
//  Created by 明津李 on 2020/8/4.
//  Copyright © 2020 Mazy. All rights reserved.
//

#import "UIColor+StoryBoard.h"

@implementation UIView (StoryBoard)

- (void)setMassBackgroundColor:(UIColor *)color{
    self.backgroundColor = kMassColor;
}

- (void)setMassBackgroundColorWithAlpha:(float)alpha{
    self.backgroundColor = kMassColorAlpha(alpha);
}

@end

@implementation UILabel (StoryBoard)

- (void)setMassTextColor:(UIColor *)color{
    self.textColor = kMassColor;
}

@end

@implementation UIButton (StoryBoard)

- (void)setMassTitleColor:(UIColor *)color{
    
    [self setTitleColor:kMassColor forState:(UIControlStateNormal)];
    [self setTitleColor:kMassColor forState:(UIControlStateSelected)];
    [self setTitleColor:kMassColor forState:(UIControlStateHighlighted)];
}

@end

@implementation CALayer (StoryBoard)

- (void)setBorderColorFromUIColor:(UIColor *)color
{
    self.borderColor = color.CGColor;
}

- (void)setBorderMassColorFromUIColor:(UIColor *)color
{
    self.borderColor = kMassColor.CGColor;
}

- (void)setCornerRadiusWithHalfHeight:(NSNumber *)number{

    self.cornerRadius = self.frame.size.height/2;
}

- (void)setShadow:(NSNumber *)number{
    
    self.shadowOffset =  CGSizeMake(3, 3);
    self.shadowOpacity = 0.5;
    self.shadowColor =  [UIColor blackColor].CGColor;
}

@end

