• 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: Two basic questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Two basic questions


  • Subject: Re: Two basic questions
  • From: email@hidden
  • Date: Thu, 28 Feb 2002 11:38:46 -0800

1) Is there a good way to compare to NSColor objects other than, for
example, converting both to RGB and comparing values?

-isEqual: works, but be careful. It will return NO in some cases when colors are in fact the same, but are in different "color spaces". If you want to get YES even in such cases, you need to use -colorUsingColorSpaceName: to convert both to the same space (NSCalibratedRGBColorSpace might be reasonable) and then compare. But note that -colorUsingColorSpaceName: can fail and return nil. So all this gets a little complicated.

Ben Haller
Stick Software
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Random Number
  • Next by Date: Re: help system
  • Previous by thread: Re: Two basic questions
  • Next by thread: Re: Two basic questions
  • Index(es):
    • Date
    • Thread