Add a new attribute type to the WooCommerce attribute selector. This is the foundation for creating custom swatch types.
Note: After adding this, you also need to handle the attribute selection form in the product editor using the woocommerce_product_option_terms hook.
add_filter( 'product_attributes_type_selector', 'swatches_add_attribute_type' );
function swatches_add_attribute_type( $types ) {
$types['color'] = 'Color';
return $types;
}