Skip to content

getTextColorForBackground

function getTextColorForBackground(swatch): string;

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

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

Parameter Type
swatch | string | PaletteSwatch | null | undefined

string