mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-08 23:35:07 +00:00
The Generic CMYK solver clamps each ink to 0..1 after a step. When an ink sits at 0 or 1 and the step pushes it further out, the clamp removes most of the step, and the solve can stop after a step under 1e-6. Where it stopped depended on the input's last float bits. For hex ed1e79, magenta ranged from 93.2% to 93.9% and yellow from 15.3% to 16.3% over 4,001 f32 values of its red, with 230 jumps over 0.001 between neighboring values. An ink at 0 or 1 whose descent direction points out of the range now stays where it is, and the step moves the other inks. The solve stops when every ink is held. Two new tests step a channel one f32 at a time and check that every ink stays within 0.001: the red of ed1e79 (cyan held at 0) and the blue of sRGB (0, 0, 0.25) (cyan and magenta held at 1). The solver still minimizes plain Lab distance to the gamut-mapped target. The CMYK values of many RGB colors change; hex 00ff00 now separates to C=61 M=0 Y=100 K=0 (cyan 0.6235 before, 0.6064 now), and the swatch test that pins its name is updated.