Color swatches allow you to display color pills instead of standard variant pills when a product has a color variant.
Color swatches are configured through the color swatch
theme settings. Color swatches are enabled by default and can be disabled by unchecking the "Enable color swatches" setting in theme settings. Color swatches apply to product variants whose names have been added as "Variant names" in the color swatch theme settings.
If no custom colors have been configured in the theme settings, then color swatches will only work for standard CSS colors. The list of standard CSS colors can be found on the
following page. If a color option is not a standard CSS color and has not been configured in the theme settings, then it will be shown as a transparent color pill.
For example, if a product has a variant type called "color" that has been added as color swatch variant name and one of the variant options is "green", then the HTML color #008000 will automatically be shown.
To add new colors to the color swatch or to modify the color shown for a standard CSS color, use the custom color setting in the theme settings. Custom colors can be defined as HTML colors or images. To use an image as a color swatch, first upload the image as a file in the Shopify admin, then add the image file name (including the file extension) in the custom color setting.
Names and colors in the "Variant names" and "Custom colors" settings should be separated by commas, with no spaces.
See below example color swatch theme settings.