Windows

Themes

JavaScript

Listing All Themes

The Themes API is available through the glue.themes object.

To get a list of all available themes, use the list() method of the Themes API:

const allThemes = await glue.themes.list();

Current Theme

To get the currently selected theme, use the getCurrent() method of the Themes API:

const currentTheme = await glue.themes.getCurrent();

Selecting Themes

To select a theme, use the select() method of the Themes API:

const themeName = "dark"

glue.themes.select(themeName);

Theme Events

To get notified when the theme changes, use the onChanged() method of the Themes API:

glue.themes.onChanged(newTheme => {
    console.log(newTheme.name);
});

Reference

Reference