Check WCAG contrast against every gradient stop, then darken text in HLS
When a design puts text on a two-stop gradient, compute the contrast ratio against both stops and use the worse one. Designer mockups often pass on the light stop and fail on the darker one (hover states and pills are the usual culprits). A quick fix that keeps the design is to leave the gradient alone and darken only the text. Convert the text color to HLS, keep the hue and saturation, and lower lightness in 0.005 steps until the minimum ratio across all the backgrounds that text appears on is at least 4.5 (aim for about 4.6 as margin). This finds the lightest compliant shade, so the visual change stays small. When extrapolating missing theme variants by copying hue but averaging lightness and saturation from the existing themes, re-check contrast: perceptually light hues such as cyan end up much lower-contrast at the same HLS lightness.