Source

//// BWGradientWellColorWell.m// BWToolkit//// Created by Brandon Walkin (www.brandonwalkin.com)// All code is provided under the New BSD license.//#import "BWGradientWellColorWell.h"staticNSColor*borderColor;staticfloatbezelThickness=2;@implementationBWGradientWellColorWell@synthesizegradientWell;+(void)initialize{borderColor=[[NSColorcolorWithCalibratedWhite:(66.0/255.0)alpha:1]retain];}-(void)drawRect:(NSRect)rect{[superdrawRect:rect];[borderColorset];NSFrameRect(self.bounds);[borderColordrawSwatchInRect:NSInsetRect(self.bounds,bezelThickness+1,bezelThickness+1)];[[selfcolor]drawSwatchInRect:NSInsetRect(self.bounds,bezelThickness+2,bezelThickness+2)];}-(void)setColor:(NSColor*)color{[gradientWellsetNeedsDisplay:YES];[supersetColor:color];}@end