# BarcodeOptions.foreground Property

> BarcodeOptions.foreground property in the TX Sheet Control TypeScript API for Node.js: Six-digit RGB color. Defaults to #000000.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Property
- **Path:** TX Sheet Control > API Reference > TypeScript API > Node.js Server > BarcodeOptions > BarcodeOptions.foreground Property
- **442 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/barcodeoptions/foreground-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/barcodeoptions/foreground-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/barcodeoptions/foreground-property/llms-full.txt

---

Six-digit RGB color. Defaults to #000000.

Package: `@txtextcontrol/tx-sheet-control-server`.

### Syntax

```typescript
foreground?: string
```

### Remarks

Settings are detached snapshots. Cell values and formulas remain available beneath the symbol. Sources resolve after calculation and mail merge. See [Barcodes and QR Codes](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/barcodes/llms-full.txt) for validation, supported payloads and XLSX behavior.

### Examples

Create a barcode from application data and retain its editable workbook settings.

```typescript
import { ServerSheetControl } from '@txtextcontrol/tx-sheet-control-server';
import type { BarcodeOptions } from '@txtextcontrol/tx-sheet-control-server';

const control = new ServerSheetControl();
const book = control.workbook;
const sheet = book.sheets.at(0);
sheet.cell('A1').setText('https://example.com/invoice/1042');
const options: BarcodeOptions = {
    symbology: 'qrCode', source: 'A1', showText: false,
    foreground: '#163b63', background: '#ffffff', errorCorrection: 'M', version: 3,
};
sheet.cell('B2').setBarcode(options);
sheet.cell('D2').setBarcode({ symbology: 'code128', value: '001042', showText: true });
```

---

## Nearby

- **Previous:** [BarcodeOptions.showText Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/barcodeoptions/showtext-property/llms-full.txt)
- **Next:** [BarcodeOptions.background Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/barcodeoptions/background-property/llms-full.txt)
