Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions colordump/CDColorListDumper.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,12 @@ - (void)startWithCompletionHandler:(dispatch_block_t)completionBlock;
self.implementationContents = [NSMutableArray array];

for (NSString *key in colorList.allKeys) {
NSColor *color = [colorList colorWithKey:key];
if (![color.colorSpaceName isEqualToString:NSDeviceRGBColorSpace]) {
printf("Color %s isn't device RGB. Skipping.", [key UTF8String]);
continue;
}
NSColor *rawColor = [colorList colorWithKey:key];

NSColor *deviceRGBColor = [rawColor colorUsingColorSpaceName:NSDeviceRGBColorSpace];

CGFloat r, g, b, a;
[color getRed:&r green:&g blue:&b alpha:&a];
[deviceRGBColor getRed:&r green:&g blue:&b alpha:&a];

NSString *declaration = [NSString stringWithFormat:@"+ (UIColor *)%@Color;\n", [self methodNameForKey:key]];
[self.interfaceContents addObject:declaration];
Expand Down