• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSColor to color name/NSString:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSColor to color name/NSString:


  • Subject: NSColor to color name/NSString:
  • From: "Trevor Goodson" <email@hidden>
  • Date: Fri, 08 Jul 2005 18:24:06 -0400


Hello all,

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"];

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;

Thanks in advance for any help/comments!

Trevor


_______________________________________________ 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
  • Follow-Ups:
    • Re: NSColor to color name/NSString:
      • From: Ricky Sharp <email@hidden>
  • Prev by Date: Re: What is a "positional parameter" in the context of localizable strings?
  • Next by Date: Re: Str255 to NSString and Back
  • Previous by thread: Re: NSCombobox subclass and binding ?
  • Next by thread: Re: NSColor to color name/NSString:
  • Index(es):
    • Date
    • Thread