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

top-level-interface-dark-mode-p Function

Summary

Determines if a top level interface is displayed in dark mode.

Package

capi

Signature

top-level-interface-dark-mode-p interface => dark-mode-p

Arguments
interface
An interface instance.
Values
dark-mode-p
A Boolean.
Description

The function top-level-interface-dark-mode-p returns true if interface is currently displayed in dark mode and false otherwise. If interface is not displayed, top-level-interface-dark-mode-p returns false.

On Cocoa, interface is in dark mode if the name of its effective Appearance contains "dark" (ignoring case). That works for the standard appearances, but may not work for user defined ones.

On Microsoft Windows running Windows 10 or later, LispWorks checks the registry for the mode using the key "AppsUseLightTheme" in "HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionThemesPersonalize".

On GTK+ 2 and Microsoft Windows before Windows 10, interface is in dark mode if its default background color is dark, which is checked summing the RGB values and comparing with 1.5.

On GTK+ 3, LispWorks uses the color-scheme from the gsettings object with schema_id "org.gnome.desktop.interface" to check for the mode, which gives the setting on the machine that LispWorks runs on. You can also override it using force-dark-mode.

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

interface
top-level-interface-color-mode


CAPI User Guide and Reference Manual (Unix version) - 18 Feb 2025 15:34:22