Figma has a built-in color contrast tool

Did you know that Figma has a built-in color contrast tool? When you open the color picker, press the color contrast button on the top right.

The foreground color or fill color of whatever you are selected will be compared against the background it's on. This way, you can directly see whether a color contrast combination complies with WCAG AA or AAA.