Javascript: Selection.getTextBackColor Method
Description
Gets the background color of the selected text.
Syntax
<void> Selection.getTextBackColor(<RequestStringCallback> callback, [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| callback | Receives the background color of the selected text either as a hex value or an HTML color name. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates Selection.getTextBackColor in a practical document-editing workflow. It gets the background color of the selected text.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.selection.getTextBackColor(
function(result) {
console.log("get text back color result:", result);
},
onTxError
);