Re: NSColor to color name/NSString:
Re: NSColor to color name/NSString:
- Subject: Re: NSColor to color name/NSString:
- From: Ricky Sharp <email@hidden>
- Date: Fri, 8 Jul 2005 19:05:34 -0500
On Jul 8, 2005, at 5:24 PM, Trevor Goodson wrote:
I'm working on an application that uses color. The user can color
any number of graphics items and these colors are stored as NSData
using the NSArchiver approach:
NSData *theData = [NSArchiver archivedDataWithRootObject:
(NSColor*)color];
[currentTag setObject:theData forKey:@"color"];
NSColor conforms to NSCoding, so you can archive them directly.
Also, you may want to look into using NSKeyedArchiver.
My question:
Is it it possible to obtain the name of the color when the user
selects it using "crayons" or perhaps the "color palettes" tool via
the color panel. For example, you will notice the system already
displays the color names in these two modes; so I was wondering if
I can access this information. Eventually we want to store names of
colors in SQL.
If there is a "cocoa way" of doing this, I'm in favor of doing
that. Otherwise, I will have to write my own look-up table & function;
I don't think you can access those names.
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
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