DEFAULTCOLOR function

DEFAULTCOLOR() DEFAULTCOLOR()

Returns

Color

A special color value instructing Calcapp to use a default value for a color.

Returns a special color value instructing Calcapp to use a default value for a color, regardless of whether there is a color which can be inherited.

Normally, if a color is not specified, it is inherited. For instance, if a color for the label of a field is not specified at the level of that particular field, it is inherited from the screen owning the field, specifically from the field label color maintained by all screens. If that color isn't specified either, the color is inherited from the parent of that screen (the one that appears before it when navigating in the app), and so on.

If the first screen doesn't specify a field label color either, a default color is used. Default colors are specified at the level of an app and consist of a primary color (used for things like the navigation bar), an accent color (used for things like the thumb of switch fields), a background color, a warning color and a foreground color. Field labels use the foreground color as the ultimate fallback color, if there is no color to inherit.

What the DEFAULTCOLOR function does is that it allows a default color to be selected directly, instructing Calcapp that no attempt should be made to inherit a color before falling back on a default color.

This function is Calcapp-specific.

Example

IF(Field1 > 20, Color.Red, DEFAULTCOLOR())IF(Field1 > 20; Color,Red; DEFAULTCOLOR())

Returns the color red if the value of Field1 is greater than 20, and the default color otherwise.