Re: Two basic questions
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.