Convert OKLCH to a hex string. If the color falls outside the sRGB gamut we
reduce chroma toward the achromatic axis (preserving L and H) until it fits,
then hard-clamp any residual channel error. This keeps hues perceptually
stable instead of the hue-shifting that naive per-channel clamping causes.
Convert OKLCH to a hex string. If the color falls outside the sRGB gamut we reduce chroma toward the achromatic axis (preserving L and H) until it fits, then hard-clamp any residual channel error. This keeps hues perceptually stable instead of the hue-shifting that naive per-channel clamping causes.