<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@csstools/color-helpers](./color-helpers.md) &gt; [contrast\_ratio\_wcag\_2\_1](./color-helpers.contrast_ratio_wcag_2_1.md)

## contrast\_ratio\_wcag\_2\_1() function

WCAG 2.1 contrast ratio

**Signature:**

```typescript
export declare function contrast_ratio_wcag_2_1(color1: Color, color2: Color): number;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

color1


</td><td>

[Color](./color-helpers.color.md)


</td><td>


</td></tr>
<tr><td>

color2


</td><td>

[Color](./color-helpers.color.md)


</td><td>


</td></tr>
</tbody></table>

**Returns:**

number

