mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-27 16:59:43 +01:00
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.