Skip to main content

GetBorderColor

Returns the border color of the current form.

Inherited from ApiFormBase.GetBorderColor.

Syntax​

expression.GetBorderColor();

expression - A variable that represents an ApiTextForm class.

Parameters​

This method doesn't have any parameters.

Returns​

ApiColor

Example​

Read the border color surrounding a text field in a document.

// How do I find out what color the border of a text entry area is in a document?

// Check the outline color of a text field to confirm its styling in a document.

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.SetBorderColor(Api.RGB(255, 111, 61));
let borderColor = textForm.GetBorderColor();
paragraph = Api.CreateParagraph();
paragraph.AddText("Border color (RGB): (" + borderColor.r + ", " + borderColor.g + ", " + borderColor.b + ")");
doc.Push(paragraph);