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
| Name | Type | Description |
|---|---|---|
themeName | String | Theme color key name to look up (for example, "Label/tertiary") |
optionValue | int | Return 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"
Related
$app.changeTheme(type)— Switch the app theme$app.isDarkTheme()— Whether the app's current theme is dark