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

Re: NSColor <-> NSString


  • Subject: Re: NSColor <-> NSString
  • From: "Simson Garfinkel" <email@hidden>
  • Date: Tue, 25 Dec 2001 09:28:00 -0500

thanks for the pointer. A bit more complicated than what I want, to be sure.
I was hoping that there would be some simple thing in the AppKit for
transforming a Color into a String, the way there is stuff for coding other
basic values into strings. I don't want a list of colors; I just want one
color. I guess I'll need to write it.

I think that one of the fundamental differences between _Cocoa Programming
for Mac OS X_ and the book that I am doing with Michael Mahoney is that our
code examples all try to be as compact as possible, to show off the essence
of the AppKit. There are a few exceptions to this, but in general, we've
tried to design all of the applications in this manner.
>
> NSColorList has
> -(NSColor *) colorWithKey:(NSString *) key
>
> On page 296 of the new _Cocoa Programming for Mac OS X_ book, there is
> an example class ColorFormatter which as an NSFormatter converts from
> Strings to NSColors and vice-versa.
> It has some code for converting from an arbitrary color to the nearest
> named color string in an NSColorList, and searching through color lists
> for substrings.


  • Follow-Ups:
    • Re: NSColor <-> NSString
      • From: Vince DeMarco <email@hidden>
References: 
 >Re: NSColor <-> NSString (From: Alex Rice <email@hidden>)

  • Prev by Date: Re: Sheet from another nib
  • Next by Date: Re: NSColor <-> NSString
  • Previous by thread: Re: NSColor <-> NSString
  • Next by thread: Re: NSColor <-> NSString
  • Index(es):
    • Date
    • Thread