Check that a text colour reads well on its background (AA and AAA), test every pair in a palette, and get the smallest change that passes.
Every pair in a palette
Paste up to ten colours (one per line or separated by commas), or open this page from the palette generator.