Files
vectorcraft/crates
dotCooCoo 6ec7d73a5a Color: the largest OKLCH chroma that fits sRGB is found past a gap
Along a hue at a given lightness, sRGB can hold two runs of chroma with
chromas outside it between them (near blue, a run of low chroma and one
ending at the blue primary). max_chroma bisected as if sRGB held one run,
so at blue's lightness and hue it gave about 0.266 instead of the
primary's 0.3132, and a request for full chroma came out desaturated.

- The search now finds where each linear sRGB component's cubic reaches
  an edge of the gamut, tests the chromas between those points from the
  top down, and refines the highest run that fits.
- from_oklch lowers a chroma outside sRGB to the largest chroma under it
  that fits, so a chroma in the gap goes to the top of the run under it
  instead of being clamped channel by channel.
- The C track of OKLCH Sliders dims a gap under the largest chroma and
  shows there the color a pick stores.
- Tests cover the blue primary, a dark blue whose runs are far apart, the
  C track over that gap, and a grid of lightness and hue where no chroma
  above the one found fits.
2026-11-16 06:30:15 -08:00
..
…
…