# bestTextContrast

```ts
function bestTextContrast(hex): {
  color: "#000000" | "#FFFFFF";
  passesAA: boolean;
  passesAALarge: boolean;
  ratio: number;
};
```

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

Same choice as the recommended text colour, but it also returns **the ratio
it achieved** and whether that passes AA — so a caller can decide with the
number in front of them instead of assuming it was enough.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `hex` | `string` |

## Returns

```ts
{
  color: "#000000" | "#FFFFFF";
  passesAA: boolean;
  passesAALarge: boolean;
  ratio: number;
}
```

### color

```ts
color: "#000000" | "#FFFFFF";
```

### passesAA

```ts
passesAA: boolean;
```

### passesAALarge

```ts
passesAALarge: boolean;
```

### ratio

```ts
ratio: number;
```