forked from sononum/bwtoolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBWGradientWellColorWell.m
More file actions
42 lines (30 loc) · 850 Bytes
/
Copy pathBWGradientWellColorWell.m
File metadata and controls
42 lines (30 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//
// BWGradientWellColorWell.m
// BWToolkit
//
// Created by Brandon Walkin (www.brandonwalkin.com)
// All code is provided under the New BSD license.
//
#import "BWGradientWellColorWell.h"
static NSColor *borderColor;
static float bezelThickness = 2;
@implementation BWGradientWellColorWell
@synthesize gradientWell;
+ (void)initialize
{
borderColor = [[NSColor colorWithCalibratedWhite:(66.0 / 255.0) alpha:1] retain];
}
- (void)drawRect:(NSRect)rect
{
[super drawRect:rect];
[borderColor set];
NSFrameRect(self.bounds);
[borderColor drawSwatchInRect:NSInsetRect(self.bounds, bezelThickness + 1, bezelThickness + 1)];
[[self color] drawSwatchInRect:NSInsetRect(self.bounds, bezelThickness + 2, bezelThickness + 2)];
}
- (void)setColor:(NSColor *)color
{
[gradientWell setNeedsDisplay:YES];
[super setColor:color];
}
@end