Re: Color in Cocoa
Re: Color in Cocoa
- Subject: Re: Color in Cocoa
- From: "John C. Randolph" <email@hidden>
- Date: Sat, 29 Dec 2001 15:37:54 -0800
On Saturday, December 29, 2001, at 03:00 PM, Alexander Dvorak wrote:
>
In working through many of the tutorials on the web
>
and in Learning Cocoa, I have learned how to change
>
the color to redColor, blueColor, blackColor, etc.
>
>
But how do you set the RGB and alpha values directly
>
in code (not using the colorwell)? I looked in the
>
NSColor.h file, but do not see any calls like that or
>
even a structure for NSColor objects.
All of these are near the top of the file:
+ (NSColor *)colorWithCalibratedWhite:(float)white alpha:(float)alpha;
+ (NSColor *)colorWithCalibratedHue:(float)hue
saturation:(float)saturation brightness:(float)brightness
alpha:(float)alpha;
+ (NSColor *)colorWithCalibratedRed:(float)red
green:(float)green blue:(float)blue alpha:(float)alpha;
+ (NSColor *)colorWithDeviceWhite:(float)white alpha:(float)alpha;
+ (NSColor *)colorWithDeviceHue:(float)hue
saturation:(float)saturation brightness:(float)brightness
alpha:(float)alpha;
+ (NSColor *)colorWithDeviceRed:(float)red green:(float)green
blue:(float)blue alpha:(float)alpha;
+ (NSColor *)colorWithDeviceCyan:(float)cyan
magenta:(float)magenta yellow:(float)yellow black:(float)black
alpha:(float)alpha;
-jcr
"These kids today don't know the simple joy of saving four bytes
of page-0 memory on a 6502" - unknown