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.
0) Install Entityreference 7.x-1.x-dev and Field Extractor 7.x-1.x-dev.
Patch entityreference with the patch from http://drupal.org/node/1580348.
This will give you the "Rendered entity" formatter on the taxonomy term fields.
1) Select the Field Extractor formatter for the product reference field, or
add the Field Extractor views field to a view.
2) In the settings, select the color reference field that you've added to the
product type. Then select "Rendered entity" as the formatter, and
"Add to Cart form - Attribute" as the view mode.