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

Re: color


  • Subject: Re: color
  • From: Henry McGilton <email@hidden>
  • Date: Thu, 29 May 2003 15:52:36 -0700

On Thursday, May 29, 2003, at 03:37 PM, Greg Casey wrote:

<used the wrong damn address again. my response is below>

Begin forwarded message:

From: Greg Casey <email@hidden>
Date: Thu May 29, 2003 6:36:42 PM US/Eastern
To: Cocoa-Dev List <email@hidden>
Subject: Re: color

NSColor *color = [NSColor colorWithCalibratedRed:51 green:204 blue:255 alpha:1.0];

Just convert the hex values from red:33 green:CC blue:FF to decimal as shown above.

-gtc


Ahem! From the NSColor documentation:

Creates and returns an NSColor whose opacity value is alpha and whose RGB components
are red, green, and blue. (Values below 0.0 are interpreted as 0.0, and values above
1.0 are interpreted as 1.0.)

The components are floats, not integers. Try:

NSColor *colour = [NSColor colorWithDeviceRed: 0.2 green: 0.8 blue: 1.0 alpha: 1.0];


On Thursday, May 29, 2003, at 06:11 PM, Rhon Fitzwater wrote:

Can some one tell me how to set NSColor so it is this hex color
(#33CCFF ) which can be seen at
http://hotwired.lycos.com/webmonkey/reference/color_codes/

Right now I have this as my code: [NSColor cyanColor] but that color
is noticably different than what I want. If someone can help me with
the code that would be great.

thanks,

-Rhon
_______________________________________________


Best Wishes,
........ Henry


===============================+============================
Henry McGilton, Boulevardier | Trilithon Software
Objective-C/Java Composer | Seroia Research
-------------------------------+----------------------------
mailto:email@hidden | http://www.trilithon.com
|
===============================+============================
_______________________________________________
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.

References: 
 >Re: color (From: Greg Casey <email@hidden>)

  • Prev by Date: Re: color
  • Next by Date: Annoying button highlight & create palettes
  • Previous by thread: Re: color
  • Next by thread: Re: NEWBIE: Advice on Starting Out
  • Index(es):
    • Date
    • Thread