Pairs that reach the target, not swatches with a badge
Give a background and this finds foregrounds that genuinely meet your target against it — keeping your hue and reporting the exact ratio.
Pairs that reach the target, not swatches with a badge
Give a background and the roles you need. This searches OKLCH lightness for foregrounds that actually meet your target against it, keeping your hue and reporting the exact ratio.
How a candidate is found
For each role, lightness is walked in both directions in OKLCH while the hue is held and the chroma retained wherever the gamut allows. Each candidate is gamut-mapped, then the composited sRGB result is tested. The one that meets the target with the smallest perceptual change wins.
Black and white are always considered, so there is an answer whenever one exists. At AA for normal text there always is: the worst possible background is the lightness where black and white tie, and that ties at 4.583:1.
At AAA there is a band of mid-tones where neither black nor white reaches 7:1. Where that happens this says so and names the best actually available, rather than showing a badge on a failing pair.
An "accessible palette" is a category error
Contrast belongs to a pair. A palette can contain colours that work together and colours that do not, and calling the whole set accessible tells you nothing about which is which.
What is worth generating is a set of roles against one background, each with its measured ratio — which is what this produces.
Keeping the hue is the point
Any fool can make a passing pair by using black on white. The useful version keeps the colour recognisably yours and moves only as far as it has to, which is why the search reports how far it went.