# Javascript: TXTextControl.Color Constructor

> Initializes a new instance of the Color class.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Constructor
- **Introduced:** 25.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: TXTextControl.Color Constructor
- **265 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol-color/constructor/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol-color/constructor/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol-color/constructor/llms-full.txt

---

### Description

Initializes a new instance of the Color class.

### Syntax

```javascript
TXTextControl.Color(<number> a, <number> b, <number> g, <number> r)
```

### Parameters

| Parameter | Description |
|---|---|
| a | The alpha component of the color. |
| b | The blue component of the color. |
| g | The green component of the color. |
| r | The red component of the color. |

### Examples

The following example demonstrates `TXTextControl.Color` in a practical document-editing workflow. Initializes a new instance of the Color class.

```javascript
const color = TXTextControl.Color(1, 1, 1, 1);
console.log("Created TXTextControl.Color value:", color);
```

---

## Nearby

- **Previous:** [Javascript: TXTextControl.Color.b Property](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol-color/b-property/llms-full.txt)
- **Next:** [Javascript: TXTextControl.Color.g Property](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol-color/g-property/llms-full.txt)
