This module provides a "Rendered term" attribute mode, that shows the rendered term instead of a radio button (degrades to a normal radio button when JS is off) on the add to cart form.
0) Enable this module.
1) Create a Color vocabulary, add a text field called "Color" that will hold hex values.
Go to the "Manage Display" screen of that vocabulary, click the tab called "Add to Cart form - Attribute", enable only the color field (with the label hidden, and using the "Color" formatter).
2) Create several terms with matching hex colors (Black: #000000, White: #ffffff, etc).
3) Add a Color taxonomy_term_reference field to a product type.
4) When you add the color field on the product type, tick the checkbox "Enable this field to function as an attribute field on Add to Cart forms." and select "rendered term" as option of the "Attribute selection widget".
The Add To Cart form will now show the colors.
Of course, imagefields can be used instead of "textfields holding hex values" rendered as images.
The same color blocks can also be shown on the product display, representing
each color present on the referenced products.
A good match for this module is Field Extractor.
Together with this module, it allows you to show the same color representation
on a product display.