The color.oklch property rounds values too much

Short description of issue

The Liquid color.oklch property rounds lightness to a whole percent, chroma to 2 decimals, and hue to a whole degree. The rounded color renders visibly different from the hex the merchant picked.

Reproduction steps

  1. Set a color setting to #f3efe8.
  2. Output {{ settings.your_color.oklch }} in a theme file.
  3. Shopify outputs: oklch(95% 0.01 82) which is #F2EEE7
  4. The correct value for #f3efe8 is: oklch(95.33% 0.0103 81.8)

Additional info

The rounded value renders as about rgb(242 238 231) instead of rgb(243 239 232). The difference is visible in cases where an image has the exact hex background the merchant put into settings.

Suggested fix: output at least 2 decimals for lightness, 4 for chroma, and 1 for hue, for example oklch(95.33% 0.0103 81.8).

What type of topic is this

Bug report