BarcodeOptions.foreground Property
Six-digit RGB color. Defaults to #000000.
Package: @txtextcontrol/tx-sheet-control.
Syntax
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 for validation, supported payloads and XLSX behavior.
Examples
Create a barcode from application data and retain its editable workbook settings.
import { Workbook } from '@txtextcontrol/tx-sheet-control';
import type { BarcodeOptions } from '@txtextcontrol/tx-sheet-control';
const book = new 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 });