Name
NSColorList — Mac OS X 10.0
Synopsis
This class manages an ordered, named list of
NSColors. The operating system itself provides
several color lists, which are visible in the Color panel of any
application. To obtain an array of available color lists, use the
class method availableColorLists. To manage the
colors contained within a color list we have several methods at our
disposal. The method colorWithKey: will return the
color associated with the indicated key. Colors are added to the list
using the method insertColor:key:atIndex:. To
remove a color, use removeColorWithKey:. To change
which color is associated with a key, use the method
setColor:forKey:.
An important feature of color list objects is that they can be
written to files that are kept in well-known locations in the
filesystem, thus making them easily accessed by other applications.
To store a color list to file, use the method
writeToFile:. Passing nil to
this method causes the color list to be stored in the users private
color lists directory with the filename
listname.clr. To initialize a color list object
from a stored color list, use the initializer
initWithName:fromFile:.
|
|
@interface NSColorList : NSObject <NSCoding>
|
// Initializers
|
- (id)initWithName:(NSString *)name fromFile:(NSString *)path; |
- (id)initWithName:(NSString *)name; |
// Accessor Methods
|
- (void)setColor:(NSColor *)color forKey:(NSString ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access