Color swatches shopify product page - debut theme

PHOTO EMBED

Sun Feb 13 2022 13:56:32 GMT+0000 (UTC)

Saved by @websensepro #shopify #theme #dawn

{% if product.variants[forloop.index0].metafields.color.values and option.name == 'Color' %}
  <label for="{{ section.id }}-{{ option.position }}-{{ forloop.index0 }}" style="background-color: {{product.variants[forloop.index0].metafields.color.values}}">&nbsp;
  </label>
{% else %}
  <label for="{{ section.id }}-{{ option.position }}-{{ forloop.index0 }}">
    {{ value }}
  </label>
{% endif %}
content_copyCOPY

https://websensepro.com/blog/add-color-swatches-on-shopify-product-page-dawn-theme/