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.

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.