SetHighlight
Specifies a highlighting color which is applied as a background to the contents of the current paragraph.
Syntax
expression.SetHighlight(sColor);
expression - A variable that represents a ApiParagraph class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| sColor | Required | highlightColor | Available highlight color. |
Returns
Example
Add a background highlight color to paragraph text in a document.
// How do I highlight the text of a paragraph with a color in a document?
// Draw attention to paragraph content by painting its background with a chosen color in a document.
let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("This is a paragraph with the text highlighted with light gray color.");
paragraph.SetHighlight("lightGray");