I want to show that there are more color options available for an item on the collection page.
I found this code below which works for Brooklyn theme. It assigns a hex color to the color name in the listing. How can I adapt this for 2.0 Taste theme?
Thanks!
{% assign colortab = “blushpink,rosepink,white,beige,mintgreen,pastelpurple,blackwhite,multicolor,darkgreen,lightgreen,green,black,royalblue,heathergrey,darkheathergrey,red,yellow,opal,burgundy,blue,pink,orange” | split: ‘,’ %}> {% assign codcolortab = “#C1AFB0,#CEA097,#f5f5dc,#f5f5dc,#D7ECC8,#b39eb5,#000000,#D9A5A9,#6E8557,#C1CDBA,#C1CDBA,#000000,#253369,#b7b7b3,#b5b5b0,#cc1917,#f5cd61,#a4a6aa,#ab1a1a,#9CC6DE,#FFC0CB,#f4a261” | split: ‘,’ %}> {% for option in product.options %}> {% if option == ‘Color’ or option == ‘color’ or option == ‘Couleur’ or option == ‘couleur’ %}> {% assign index = forloop.index0 %}> {% assign colorlist =‘’ %}> {% assign color =‘’ %}> {% for variant in product.variants %}> {% capture color %}{{ variant.options[index] }}{% endcapture %}> {% unless colorlist contains color %}> {% capture tempList %}{{colorlist | append: color | append: ‘|’ }}{% endcapture %}> {% assign colorlist = tempList %}> {% for ctab in colortab %}> {% assign c = color | remove: ’ ’ | remove: ‘&’ | handle | downcase %}> {% if ctab == c %}> {% assign i = forloop.index | minus: 1%}> >
{% endif%}> {% endfor %}> {% endunless %}> {% endfor %}> {% assign colorArray = colorlist | split: ‘|’ %}> {% endif %}> {% endfor %}
