Text needs enough contrast against its background to be readable. The measure is the contrast ratio: at least 4.5:1 for body text and 3:1 for large text.
Use colors from the system's tokens (no page by this name yet) instead of picking new ones, since every token pair was chosen with contrast in mind. The palette is on the Color (no page by this name yet) page.
Keyboard users depend on a visible outline as well: see Focus ring (no page by this name yet), and check that it also meets 3:1.
- Pick the text color and its background from the tokens.
- Check the pair with a contrast checker.
- If it fails, choose a darker text token or a lighter background token.