# Javascript: FormattingStyle.setForeColor Method

> Sets the style's color used to display the text.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: FormattingStyle.setForeColor Method
- **266 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/formattingstyle/setforecolor-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/formattingstyle/setforecolor-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/formattingstyle/setforecolor-method/llms-full.txt

---

### Description

Sets the style's color used to display the text.

### Syntax

```javascript
<void> FormattingStyle.setForeColor(<String> color, <EmptyRequestCallback> callback)
```

### Parameters

| Parameter | Description |
|---|---|
| color | The style's color used to display the text. |
| callback | Is called when the operation completed. |

### Examples

The following example demonstrates `FormattingStyle.setForeColor` in a practical document-editing workflow. It sets the style's color used to display the text.

```javascript
function configureForeColor(formattingStyle) {
    formattingStyle.setForeColor(
        "#ffd54f",
        function() {
            console.log("set fore color completed.");
        }
    );
}
```

---

## Nearby

- **Previous:** [Javascript: FormattingStyle.setFontSize Method](https://docs.textcontrol.com/ds-server/reference/javascript/formattingstyle/setfontsize-method/llms-full.txt)
- **Next:** [Javascript: FormattingStyle.setItalic Method](https://docs.textcontrol.com/ds-server/reference/javascript/formattingstyle/setitalic-method/llms-full.txt)
