• 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
Re: Determine colorlist/-name after NSColorPanel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determine colorlist/-name after NSColorPanel


  • Subject: Re: Determine colorlist/-name after NSColorPanel
  • From: Matthias Arndt <email@hidden>
  • Date: Sat, 7 Mar 2009 16:52:45 +0100

At least I found my error with this one:

Today I tested a bit with "catalogNameComponent" and "colorNameComponent", but always received an exception. I tried to convert the selected color into NSNamedColorSpace, but didn't get it work. Has anybody got an example or a hint?

I mixed up "catalogs" and "color lists" ... all colors I selected just weren't from catalogs. If I pick a color from the "Developer" color list, the code works: a color name from the system catalog is returned by this code:


- (void)changeColor:(id)sender
{
// Delegate of NSColorPanel

NSColor *namedColor = [[sender color] colorUsingColorSpaceName:NSNamedColorSpace];
NSString *colorCatalog;
NSString *colorName;
if (namedColor == nil)
{
colorName = @"undefined";
colorCatalog = @"undefined";
}
else
{
colorName = [namedColor colorNameComponent];
colorCatalog = [namedColor catalogNameComponent];
}
DebugLog(@"Color changed: %@ (%@, %@)", namedColor, colorName, colorCatalog);
}

So I'm back to my original question:

Is there a way to get the following information after a color was selected via NSColorPanel:

a) if the color was picked from a list
b) the name of the color list
c) the name of the color within this list

I'm afraid there's no way ...

Mattes _______________________________________________

Cocoa-dev mailing list (email@hidden)

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/Update your Subscription:
This email sent to email@hidden


References: 
 >Determine colorlist/-name after NSColorPanel (From: Matthias Arndt <email@hidden>)

  • Prev by Date: NSPersistentDocument and initWithType:Error
  • Next by Date: preparing HTML email content for Mail.app like safari does
  • Previous by thread: Determine colorlist/-name after NSColorPanel
  • Next by thread: Re: Newbie query re notifications -- SOLVED
  • Index(es):
    • Date
    • Thread