Re: NSColor to CGColor
Re: NSColor to CGColor
- Subject: Re: NSColor to CGColor
- From: Daniel Jalkut <email@hidden>
- Date: Sun, 12 Nov 2006 10:58:19 -0500
On Nov 12, 2006, at 10:48 AM, j o a r wrote:
static CGColorRef CGColorCreateFromNSColor (CGColorSpaceRef
colorSpace, NSColor *color)
{
NSColor *deviceColor = [color colorUsingColorSpaceName:
NSDeviceRGBColorSpace];
float components[4];
[deviceColor getRed: &components[0] green: &components[1] blue:
&components[2] alpha: &components[3]];
return CGColorCreate (colorSpace, components);
}
Joar's is much smarter and generically applicable than the example I
pasted....
Daniel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden