Color_darken no longer working with variables. Anyone else?

I had a snippet in my code:

style="background-color: {{ collection.metafields.custom_fields.color | color_darken: 4 }};"

that had been working perfectly up until yesterday evening. Now, I only see a color if I remove “color_darken: 4”. I’ve tested and color_darken still works, but only so long as I only use it with a hex string, and not a variable that evaluates to a hex string.

Has anyone else noticed this change in functionality? Or is it a bug that I might be able to fix?

1 Like

For darken_color to work, I needed to pass a color string, not a colour object (from the metafield). Seems mad, but that’s what works.

{% capture my_color %}{{ product.metafields.test.accent_colour }}{% endcapture %}
{% assign my_darkened_color %}{{my_color | color_darken: 4 }}{% endcapture %}