Skip to main content

SetBackgroundColor

Sets the background color to the current form.

Syntax

expression.SetBackgroundColor(r, g, b, bNone);

expression - A variable that represents a ApiDateForm class.

Parameters

NameRequired/OptionalData typeDefaultDescription
rRequiredbyteRed color component value.
gRequiredbyteGreen color component value.
bRequiredbyteBlue color component value.
bNoneRequiredbooleanDefines that background color will not be set.

Returns

boolean

Example

This example sets the background color to the form.

let doc = Api.GetDocument();
let textForm = Api.CreateTextForm({"key": "Personal information", "tip": "Enter your first name", "required": true, "placeholder": "First name", "comb": true, "maxCharacters": 10, "cellWidth": 3, "multiLine": false, "autoFit": false});
let paragraph = doc.GetElement(0);
paragraph.AddElement(textForm);
textForm.SetBackgroundColor(255, 111, 61);