• 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: Color in Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Color in Cocoa (From: Alexander Dvorak <email@hidden>)

  • Prev by Date: Re: Lists as newsgroups (or: give chuq more work!)
  • Next by Date: NSTask and readInBackgroundAndNotify
  • Previous by thread: Color in Cocoa
  • Next by thread: NSAlias and RecentItems
  • Index(es):
    • Date
    • Thread