Skip to main content

WindowColorMode

Kindclass
Packagebackend
Full namebackend.WindowColorMode
Sourcesource/backend/WindowColorMode.hx

Public fields​

NameTypeStaticDefaultNotes
isDarkModeBoolyesfalseIf the window is currently dark mode or not.
windowHeaderColorArray<Int>yes[]Returns the current color of the header.
windowBorderColorArray<Int>yes[]Returns the current color of the border.
windowTitleColorArray<Int>yes[]Returns the current color of the title text.

Public methods​

setWindowColorMode​

static function setWindowColorMode(isDark:Bool = true)

Shortcut to both setLightMode and setDarkMode.

@param isDark Do you want to set the window to dark mode?

ParameterTypeDefault
isDark (optional)Booltrue

View source

setDarkMode​

static function setDarkMode()

Sets the window to dark mode.

View source

setLightMode​

static function setLightMode()

Sets the window to light mode (aka default).

View source

setWindowBorderColor​

static function setWindowBorderColor(color:Array<Int>, setHeader:Bool = true, setBorder:Bool = true)

Sets the header and/or border to a color of your choosing. (Only Windows 11 supports this).

@param color The color of the window border/header. organized as [R (0 to 255), G (0 to 255), B (0 to 255)]. @param setHeader Do you want to set the header to the specified color? @param setBorder Do you want to set the border to the specified color?

ParameterTypeDefault
colorArray<Int>—
setHeader (optional)Booltrue
setBorder (optional)Booltrue

View source

setWindowTitleColor​

static function setWindowTitleColor(color:Array<Int>)

Sets the window title text to a color of your choosing. (Only Windows 11 supports this).

@param color The color of the window border/header. organized as [R (0 to 255), G (0 to 255), B (0 to 255)].

ParameterTypeDefault
colorArray<Int>—

View source

redrawWindowHeader​

static function redrawWindowHeader()

Resets the window. It is recommended to use this after running any of the functions above so the effect is drawn immediately. (Windows 11 doesn't need this, but it's needed on Windows 10, or else the effect won't take place until you unfocus/refocus the window).

View source