You can add to and make ANY color with ANY name you want ... Therefore, you need to make 2 files ... ... CategoriesNSColorNSColor+YourCategories.h
@interface NSColor (YourCategories) // Tag in () is "yours" to name,
+ (NSColor *) MAUVE;
@end
and aptly named NSColor+YourCategories.mfile
#import "NSColor+YourCategories.h"
@implementation NSColor (YourCategories)
+ (NSColor *) MAUVE { static NSColor* MAUVE = nil; if( MAUVE == nil )
MAUVE = [NSColor colorWithDeviceRed:0.712 green:0.570 blue:0.570 alpha:1.000];r
return MAUVE;
}
Simply
#import NSColor+YourCategories.h
on any page you want to be able to link to your named colors, for example ...
[[self window]setBackGroundColor: [NSColor MAUVE]];
∀Ⓛ∃✖
source
share