Files
vectorcraft/docs
dotCooCoo cc5d3b5537 Color Wheel: the box and the wheel mark the contrast lines and offer the closest passing color
With Show Contrast on, the wheel's square and the box's field draw where
the color picked there meets AA (solid) and AAA (dashed) for the chosen
category, each as a white line over a black one. The field is sampled on
a 33 by 33 grid and each crossing is placed by bisection, so a line can
run across the field or up it; a passing band narrower than the samples
is found by looking for the highest ratio around a failing sample higher
than its neighbors.

When the color fails AA, or meets AA and fails AAA, a chip at the end of
the contrast row shows the closest color that passes that level, and a
click applies it. The chip keeps its space while hidden, so the row does
not move as a drag crosses a line. Screen readers read it as a button.

color.contrast takes `for` (normalText, largeText or graphics) and
answers `for` and `fix: {aa, aaa}` (no aaa for graphics): for each level,
the closest color that meets it when drawn the same way (blend modes,
opacity, translucent groups and layers, the stain of a picked symbol
object), in the model of the measured color, or null when the color
already meets it or no lightness of its hue does. The search keeps the
OKLCH hue, raises or lowers the lightness, whichever takes the smaller
step, lowers the chroma where sRGB cannot show it, and tests at most 167
colors.

Part of #978
2026-11-15 23:20:49 -08:00
..
…