GetBorderColor
返回当前表单的边框颜色。
继承自 ApiFormBase.GetBorderColor。
语法
expression.GetBorderColor();
expression - 表示 ApiTextForm 类的变量。
参数
此方法没有任何参数。
返回值
ApiColor | null | undefined
示例
读取文档中文本字段周围的边框颜色。
// 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);