Re: Saving NSColor
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.