All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

top-level-interface-color-mode Accessor

Summary

A value that indicates the color mode of a top level interface.

Package

capi

Signature

top-level-interface-color-mode interface => color-mode

setf (top-level-interface-color-mode interface) color-mode => color-mode

Arguments
interface
An interface instance.
color-mode
nil, a keyword or a string.
Values
color-mode
nil, a keyword or a string.
Description

The accessor top-level-interface-color-mode reads or sets the Appearance of interface on Cocoa. top-level-interface-color-mode has no effect on other platforms.

If color-mode is nil then interface is displayed in the Appearance specified by the System Preferences.

Otherwise, when color-mode is non-nil, it specifies that interface has its own Appearance, overriding the System Preferences.

When color-mode is a keyword, it must be one of the keywords in the following table, and it is mapped to the specified Cocoa appearance name.

Color mode keywords mapping to Cocoa appearances
KeywordCocoa appearance name

:light or :aqua

NSAppearanceNameAqua

:dark or :dark-aqua

NSAppearanceNameDarkAqua

Any other keyword will signal an error.

When color-mode is a string, it specifies the name of a Cocoa appearance, and it is looked up by calling the appearanceNamed: method of the Cocoa NSAppearance class. It is your responsibility to pass a valid string. If appearanceNamed: fails to find the appearance, a warning is signalled and the color-mode is ignored.

top-level-interface-color-mode-callback is called when macOS changes the Appearance.

top-level-interface-color-mode returns the desired color mode. Call top-level-interface-dark-mode-p to determine if interface is currently in dark mode.

Examples

For an example of using color-mode and color-mode-callback, see:

(example-edit-file "capi/applications/interface-color-mode")
See also

top-level-interface-color-mode-callback
top-level-interface-dark-mode-p


CAPI User Guide and Reference Manual (Macintosh version) - 01 Dec 2021 19:31:27