Instance Method

setColor:forKey:

Associates the specified NSColor object with the specified key.

Declaration

- (void)setColor:(NSColor *)color forKey:(NSColorName)key;

Parameters

color

The color to associate with the given key.

key

The key.

Discussion

If the list already contains key, this method sets the corresponding color to color; otherwise, it inserts color at the end of the list by invoking insertColor:key:atIndex:.

See Also

Managing Colors By Key

allKeys

An array of the keys by which the NSColor objects are stored in the receiver.

- colorWithKey:

Returns the NSColor object associated with the given key.

- insertColor:key:atIndex:

Inserts the specified color at the specified location in the receiver.

- removeColorWithKey:

Removes the color associated with the specified key from the receiver.