mirror of
https://github.com/Sunnyyoung/WeChatTweak-macOS.git
synced 2025-07-08 00:26:06 +08:00
25 lines
546 B
Objective-C
25 lines
546 B
Objective-C
//
|
|
// TweakColorView.m
|
|
// WeChatTweak
|
|
//
|
|
// Created by Jeason Lee on 2019/11/1.
|
|
// Copyright © 2019 Sunnyyoung. All rights reserved.
|
|
//
|
|
|
|
#import "TweakColorView.h"
|
|
|
|
@implementation TweakColorView
|
|
|
|
- (void)mouseDown:(NSEvent *)event {
|
|
[NSColorPanel dragColor:self.backgroundColor withEvent:event fromView:self];
|
|
}
|
|
|
|
- (void)setBackgroundColor:(NSColor *)backgroundColor {
|
|
_backgroundColor = backgroundColor;
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
self.layer.backgroundColor = backgroundColor.CGColor;
|
|
});
|
|
}
|
|
|
|
@end
|