Re: How to make an NSColor correspond to a grayscale value?
Re: How to make an NSColor correspond to a grayscale value?
- Subject: Re: How to make an NSColor correspond to a grayscale value?
- From: Lance Bland <email@hidden>
- Date: Tue, 20 Aug 2002 18:12:49 -0400
On Tuesday, August 20, 2002, at 05:19 PM, John C. Randolph wrote:
int howBright; // something between 0 and 255
NSColor *myGreyLevel = [NSColor colorWithCalibratedWhite:howBright/255
alpha:1.0];
That will not work because howBright/255 gets implicitly cast to 0 or 1.
howBright/255.0 might be right, depending on round off error.
but it is probably better to make your own storage type. I don't think
NSColor is appropriate enough for discrete color ranges.
-lance
------------------------------------
Lance Bland
mailto:email@hidden
web charts at
http://www.vvi.com/products/chart
_______________________________________________
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.