# getTextColorForBackground

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

Defined in: packages/asset-client/src/palette.ts:82

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

## Parameters

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

## Returns

`string`