Colour metafield displaying background colour - Non variant

I am hoping someone will be able to help me work out why the background colour held in the metafield is not displaying correctly with the following output;

{% assign product_color = product.metafields.Product.flower_colour %}
{% if product_color != blank %}

Colors:

{% endif %}

Shows like this on the store;

Metafield listed for the product as follows;

LLGC_1-1676756550082.png

Your namespace for the metafields really is “Product”?

Would really want to see a link where this is shown to rule out that it’s not other CSS that’s cascading over what’s set here. Are you able to share it?

Have you done the sanity check of just outputting the value of the metafield? If so and it does show the hex colour it adds some weight to it being other CSS at play.

The output seems to match the hex colour for this plant;

I removed the {% assign product_color = product.metafields.Product.flower_colour %} and just used the {% product.metafields.Product.flower_colour %} instead but still didn’t work.

Since the output is correct must have something to do with the style??

Were you able to solve this? I am running into the same issue

Yes I did end up getting it resolved with the following output:

{% assign colors = product.metafields.Product.flower_colour | remove: ‘[’ | remove: ‘]’ | remove: ‘"’ | split: ‘,’ %} {% if colors.size > 0 %}

You could try this too just edit for correct metafield name

unfortunately it did not work for me. How were you able to come to
this conclusion?

As per my previous post the output was the hex colour code inside [‘colour’]. Hence the first part was to remove this, the second part was to handle items that had multiple colours, finally was to handle any items that had no colour applied by if statement.

This obviously worked for me as the output I receive made sense. You may need to output just the “colour” and see if that works for you or if you have other output first.