Re: When is (NSColor) black not black?
Re: When is (NSColor) black not black?
- Subject: Re: When is (NSColor) black not black?
- From: Ricky Sharp <email@hidden>
- Date: Mon, 2 May 2005 15:44:50 -0500
On May 2, 2005, at 1:06 PM, Mark Dawson wrote:
I'm not sure if I'm doing a compare wrong, but if I set my color
wheel to black (10.3.9, using the "named" colors/3 section from
left of color wheel), it doesn't seem to compare correctly:
if ([[colorWheel color] isEqual:[NSColor blackColor]])
doSomething; <--- never equals
I think this is just doing instance comparison (i.e. checking if your
objects have the same id values).
While there isn't a isEqualToColor: method, you could add that as a
category:
- (BOOL)isEqualToColor:(NSColor*)aColor
{
// Here, you could compare individual components.
// Although, may have to pay attention to color spaces
}
--
Rick Sharp
Instant Interactive(tm)
_______________________________________________
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