Can't Convert NSNamedColorSpace to NSDeviceRGBColorSpace?

Posted by Bret on Stack Overflow See other posts from Stack Overflow or by Bret
Published on 2010-04-22T00:39:51Z Indexed on 2010/04/22 0:43 UTC
Read the original article Hit count: 414

Filed under:
|

Can anyone tell me why this colorUsingColorSpaceName is returning nil? For example, the following code block will print "deviceColor is nill":

NSColor *color = [NSColor windowBackgroundColor];
NSColor *deviceColor = [color colorUsingColorSpaceName: NSDeviceRGBColorSpace];
if(deviceColor == nil) NSLog(@"deviceColor is nill");

How can I convert an NSColor in the NSNamedColorSpace? I need to be able to get the color components so i can convert an NSColor to a CGColorRef

© Stack Overflow or respective owner

Related posts about cocoa

Related posts about objective-c