This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v20.6
FORM Get color scheme

FORM Get color scheme 


 

FORM Get color scheme -> Function result 
Parameter Type   Description
Function result  Text in Color scheme of current form: "light" or "dark"

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 

Product: 4D
Theme: Forms
Number: 1761

This command has platform-specific behavior

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v19

 
ARTICLE USAGE

4D Language Reference ( 4D v20)
4D Language Reference ( 4D v20.1)
4D Language Reference ( 4D v20.2)
4D Language Reference ( 4D v20.3)
4D Language Reference ( 4D v20.4)
4D Language Reference ( 4D v20.5)
4D Language Reference ( 4D v20.6)