FORM Get color scheme
FORM Get color scheme : Text
Parameter | Type | Description | |
---|---|---|---|
Function result | Text | ← | Color scheme of current form: "light" or "dark" |
Description
The FORM Get color scheme command returns the name of the actual color scheme of the currently displayed form. If there is no current form, the command returns an empty string.
Note: On Windows, this command always returns "light".
The actual color scheme of a form is defined by:
- the "Color Scheme" form property (see colorScheme);
- if "Color Scheme" set to "inherited", a call to the SET APPLICATION COLOR SCHEME command;
- if SET APPLICATION COLOR SCHEME not called or called with "inherited" parameter value, the Settings (host database Settings in case of a component);
- if Settings set to "inherited", the OS user preferences.
Please refer to the SET APPLICATION COLOR SCHEME command for details about color scheme names.
Example
You want to load a picture depending on the form current scheme:
$txt_suffix:=Choose((FORM Get color scheme="dark");"_dark";"")
READ PICTURE FILE(Get 4D folder(Current resources folder)+"myPict"+$txt_suffix+".png";$Pic_icon)
Note: It is recommended to use css to adapt form objects design to the current scheme.
See also
Get application color scheme
SET APPLICATION COLOR SCHEME
Properties
Command number | 1761 |
Thread safe | ✗ |