1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- //
- // ColorIndicatorView.m
- // DvioomColorPicker
- //
- // Created by yanhuanpei on 2018/12/25.
- // Copyright © 2018 zhuk. All rights reserved.
- //
- #import "ColorIndicatorView.h"
- @implementation ColorIndicatorView
- - (instancetype)init
- {
- self = [super init];
- if (self) {
- self.frame = CGRectMake(0, 0, 15, 15);
-
- self.backgroundColor = [UIColor clearColor];
- self.layer.borderColor = [UIColor whiteColor].CGColor;
- self.layer.shadowColor = [UIColor blackColor].CGColor;
-
- //阴影
-
- self.layer.shadowOffset = CGSizeZero;
- self.layer.shadowOpacity = .7f;
- self.layer.shadowRadius = 4; //半径
-
- self.layer.cornerRadius = CGRectGetWidth(self.frame) / 2;
- self.layer.borderWidth = 2;
-
- }
- return self;
- }
- - (instancetype)initWithFrame:(CGRect)frame
- {
- self = [super initWithFrame:frame];
- if (self) {
- self.backgroundColor = [UIColor clearColor];
- self.layer.borderColor = [UIColor whiteColor].CGColor;
- self.layer.shadowColor = [UIColor blackColor].CGColor;
- //阴影
- self.layer.shadowOffset = CGSizeZero;
- self.layer.shadowOpacity = .7f;
- self.layer.shadowRadius = 4; //半径
-
- self.layer.cornerRadius = CGRectGetWidth(self.frame) / 2;
- self.layer.borderWidth = 2;
- }
- return self;
- }
- - (void)setCurColor:(UIColor *)curColor{
- _curColor = curColor;
- self.backgroundColor = _curColor;
- self.layer.shadowColor = _curColor.CGColor;
-
- }
- @end
|