Docs (4.0.0)
class UITheme property

colors

A map that defines a set of predefined colors.

colors: Map<string, UIColor>

Description

The colors defined by this map are used by UIColor objects that are instantiated with the color name, e.g. ui.color("Primary") (which returns new UIColor("Primary")). Default colors are also available as static properties of ui.color(), e.g. ui.color.PRIMARY.

Color changes may not be applied to views that are already rendered. If needed, re-render content using app.renderer.remount(), or change the theme altogether (use UITheme.clone() to create a new theme).

Example

useWebContext((options) => {
  options.theme.colors.set("background", ui.color.DARKER_GRAY);
  options.theme.colors.set("foo", ui.color("#e0b0ff"))
  // ...
});

Related

  • class UIThemeA collection of default style options, colors, animations, effects, and icons, part of the global application context.