< Previous PageNext Page > Hide TOC

Accessing System Colors

NSColor has a number of methods that return system colors: colors controlled by user preferences. These colors—currently only selectedControlColor and selectedTextBackgroundColor—should be used by developers who want to create custom controls or subclass existing controls while honoring the user's color preferences.

Note: A number of system colors, while still valid, are no longer meaningful under Aqua. These include any of the ones with "control" in their name. They return the old Platinum appearance colors which are usually a shade of gray.

System colors are implemented as named colors in a special color list named “Developer.” You can examine this color list in the color panel of any application that supports colors. For more on named colors and color lists, see “About Color Lists.”

To extract the components of a system color, you must use the NSColor method colorUsingColorSpaceName: to convert the color to a color space known to respond to the component accessor methods you need; see “Creating and Converting Colors Using Color Spaces” for more about color conversion.

An NSSystemColorsDidChangeNotification is sent when the system colors have been changed (such as through a system control panel interface). If you have any non-system colors that depend on the system colors, you can change them when you receive this notification.



< Previous PageNext Page > Hide TOC


© 2005, 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-03-04)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.