# getTextColorForBackground

```ts
function getTextColorForBackground(swatch): string;
```

Defined in: packages/asset-client/dist/index.d.ts:195

Recommended text color (#000 or #FFF) for any background hex,
computed via WCAG relative luminance.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `swatch` | \| `string` \| [`PaletteSwatch`](/api/nitida/sdk/type-aliases/paletteswatch/) \| `null` \| `undefined` |

## Returns

`string`