Re: Trouble with NSColor

2009-08-13 Thread Andy Lee
On Aug 13, 2009, at 1:27 PM, Daniel Furrer wrote: Is "foo" itself nil? No, foo is fine! =) Are you sure? I stuck your code in a button's action method and when I click the button foo is nil. I tried both your exact code and the correction Sherm pointed out. I think David Duncan has t

Re: Trouble with NSColor

2009-08-13 Thread Sherm Pendley
On Thu, Aug 13, 2009 at 1:29 PM, Daniel Furrer wrote: > On Thu, Aug 13, 2009 at 6:51 PM, Sean McBride wrote: > >> Did you read the docs for 'redComponent'? >> >> "This method works only with objects representing colors in the >> NSCalibratedRGBColorSpace or NSDeviceRGBColorSpace color space" >> >>

Re: Trouble with NSColor

2009-08-13 Thread Sean McBride
On 8/13/09 7:29 PM, Daniel Furrer said: >> Did you read the docs for 'redComponent'? >> >> "This method works only with objects representing colors in the >> NSCalibratedRGBColorSpace or NSDeviceRGBColorSpace color space" >> >> Use colorUsingColorSpaceName:NSCalibratedRGBColorSpace to convert. > >

Re: Trouble with NSColor

2009-08-13 Thread Daniel Furrer
On Thu, Aug 13, 2009 at 6:51 PM, Sean McBride wrote: > Did you read the docs for 'redComponent'? > > "This method works only with objects representing colors in the > NSCalibratedRGBColorSpace or NSDeviceRGBColorSpace color space" > > Use colorUsingColorSpaceName:NSCalibratedRGBColorSpace to conve

Re: Trouble with NSColor

2009-08-13 Thread Daniel Furrer
> Which system color? Many system colors are patterns and thus do not have > real RGB values. > In this case I tried it with [NSColor controlColor]. It appears to be a regular color in the color panel. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.c

Re: Trouble with NSColor

2009-08-13 Thread Daniel Furrer
> Is "foo" itself nil? > No, foo is fine! =) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Upd

Re: Trouble with NSColor

2009-08-13 Thread Daniel Furrer
> When/where are you trying to do this? I tried running this in main.m, > before calling NSApplicationMain(), and got nil returned from +controlColor. > > I moved it into an -awakeFromNib call, and +controlColor returned a valid > object. That leads me to believe that some connection needs to be

Re: Trouble with NSColor

2009-08-13 Thread Sean McBride
On 8/13/09 6:24 PM, Daniel Furrer said: >I'm trying to get the RGB components of a system color. Here's what I've >been trying: > >NSColor* foo = [[NSColor controlColor] colorUsingColorSpaceName: >@"NSCalibratedRGBColorSpace"]; >NSLog(@"%f, %f, %f", [foo redComponent], [foo blueComponent],

Re: Trouble with NSColor

2009-08-13 Thread Randall Meadows
On Aug 13, 2009, at 10:33 AM, Daniel Furrer wrote: You are right. (But why?) When/where are you trying to do this? I tried running this in main.m, before calling NSApplicationMain(), and got nil returned from +controlColor. I moved it into an -awakeFromNib call, and +controlColor return

Re: Trouble with NSColor

2009-08-13 Thread David Duncan
On Aug 13, 2009, at 9:24 AM, Daniel Furrer wrote: I'm trying to get the RGB components of a system color. Which system color? Many system colors are patterns and thus do not have real RGB values. -- David Duncan Apple DTS Animation and Printing

Re: Trouble with NSColor

2009-08-13 Thread Alastair Houghton
On 13 Aug 2009, at 17:24, Daniel Furrer wrote: I'm trying to get the RGB components of a system color. Here's what I've been trying: NSColor* foo = [[NSColor controlColor] colorUsingColorSpaceName: @"NSCalibratedRGBColorSpace"]; NSLog(@"%f, %f, %f", [foo redComponent], [foo blueComponen

Trouble with NSColor

2009-08-13 Thread Daniel Furrer
I'm trying to get the RGB components of a system color. Here's what I've been trying: NSColor* foo = [[NSColor controlColor] colorUsingColorSpaceName: @"NSCalibratedRGBColorSpace"]; NSLog(@"%f, %f, %f", [foo redComponent], [foo blueComponent], [foo greenComponent]); but all I ever get is