- (void)drawRect:(NSRect)dirtyRect {
[super drawRect:dirtyRect];
CALayer *layer = [CALayer layer];
[self setWantsLayer:YES];
[layer setBackgroundColor:[NSColor redColor].CGColor];
[self setLayer:layer];
// 数值颜色设置
//self.layer.backgroundColor = [NSColor colorWithRed:0.2 green:0.5 blue:0.9 alpha:1.0].CGColor;
[self setNeedsDisplay:YES];
}