Skip to main content

GetBackgroundColor

Returns the background color of the current form.

Inherited from ApiFormBase.GetBackgroundColor.

Syntax​

expression.GetBackgroundColor();

expression - A variable that represents an ApiSignatureForm class.

Parameters​

This method doesn't have any parameters.

Returns​

ApiColor

Example​

Read the background color applied to a signature field in a document.

// How do I find out what background color a signature field has in a document?

// Inspect the fill color behind a signature field to use or display the value in a document.

let doc = Api.GetDocument();

const signatureForm = Api.CreateSignatureForm({
'key': 'Signature',
'tip': 'Please sign here',
'placeholder': 'Signature',
});

const themeColor = Api.RGB(0, 255, 255);
signatureForm.SetBackgroundColor(themeColor);
const backgroundColor = signatureForm.GetBackgroundColor();

let paragraph = doc.GetElement(0);
paragraph.AddText('Background color HEX: ' + backgroundColor.GetHex());
paragraph.AddLineBreak();
paragraph.AddElement(signatureForm);