33@implementation OOColor (NSColorConversion)
38 [
self getRed:&r green:&g blue:&b alpha:&a];
39 return [NSColor colorWithDeviceRed:r green:g blue:b alpha:a];
44@implementation NSColor (OOColorConversion)
46+ (NSColor *)colorWithOOColorDescription:(
id)description
55 [[
self colorUsingColorSpaceName:NSCalibratedRGBColorSpace] getRed:&r green:&g blue:&b alpha:&a];
62@implementation NSAttributedString (OODebugExtensions)
64+ (id)stringWithString:(NSString *)string
66 return [[[
self alloc] initWithString:string] autorelease];
70+ (id)stringWithString:(NSString *)string font:(NSFont *)font
72 if (
string ==
nil)
return nil;
73 NSDictionary *attr = [NSDictionary dictionaryWithObject:font forKey:NSFontAttributeName];
74 return [[[
self alloc] initWithString:string attributes:attr] autorelease];
79@implementation NSMutableAttributedString (OODebugExtensions)
81- (void)setString:(NSString *)string
83 [
self setAttributedString:[string asAttributedString]];
88@implementation NSString (OODebugExtensions)
90- (NSAttributedString *)asAttributedString
92 return [NSAttributedString stringWithString:self];