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

Re: Saving NSColor


  • Subject: Re: Saving NSColor
  • From: Ali Ozer <email@hidden>
  • Date: Thu, 9 May 2002 16:01:16 -0700

... Since we can save NSData to
the user defaults, you can archive your NSColor object and store the
resulting NSData; later you can retrieve the NSData from user defaults and
unarchive it into an NSColor object. Check out the class documentation for
NSArchiver and NSUnarchiver for more information. Storing the RGB values as
you suggest is also a possibility, but I think archiving is more "elegant"
and straightforward. Hope that helps...
Mike Beam

This is definitely the best solution as it allows non-RGB colors to be saved (CMYK, patterns, etc).
There are NSColors that you can't extract RGB from.
Ali
_______________________________________________
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: Saving NSColor (From: Mike Beam <email@hidden>)

  • Prev by Date: Re: Hiding superclass methods
  • Next by Date: Re: Hiding superclass methods
  • Previous by thread: Re: Saving NSColor
  • Next by thread: RE: Saving NSColor
  • Index(es):
    • Date
    • Thread