Skip to main content

colorValue

Description

Looks up the actual color value for a theme color name and returns it as a string. Returns an empty string when the name isn't found.

Parameters

NameTypeDescription
themeNameStringTheme color key name to look up (for example, "Label/tertiary")
optionValueintReturn format. 1 returns the integer value as a plain string; any other value returns an 8-digit uppercase hexadecimal ARGB string.

Returns

String

Example

var c = $app.colorValue("Label/tertiary", 0); // For example: "FF1E88E5"
  • $app.changeTheme(type) — Switch the app theme
  • $app.isDarkTheme() — Whether the app's current theme is dark