Type Appearance

type Appearance uint8

Appearance is the look the system is set to: light or dark.

Constants

const (
	// AppearanceUnknown means the system does not say: a desktop without a
	// preference, or a platform that cannot be asked.
	AppearanceUnknown Appearance = iota
	AppearanceLight
	AppearanceDark
)

Constructors

SystemAppearance#

func SystemAppearance() Appearance

SystemAppearance reports whether the system is set to a light or a dark look, so an application can follow it until the user picks one. It reads the setting when called and is cheap enough for a frame, but a change is only heard through WatchSystemAppearance.

macOS reports the application's effective appearance, Windows the "choose your default app mode" setting, the browser prefers-color-scheme, and Linux the desktop portal's org.freedesktop.appearance color-scheme, then, without one, the XSETTINGS manager, GTK_THEME and the GTK and KDE configuration files (unknown when none says). A headless Driver reports what SetSystemAppearance last set, unknown at first, so a test never depends on the machine it runs on.

Methods

String#

func (appearance Appearance) String() string