Background and text colour picker display

Hi

I have a simple form that has 6 dropdowns that hold colour values like this:

AliceBlue | #F0F8FF

AntiqueWhite | #FAEBD7

Aqua | #00FFFF

etc etc

The 6 colour values will be used to create 3 pairs of background and text colours.

What I would like to do is to display the chosen pairs of text on background in a table cell next to the dialog boxes.

So if you were to choose black and white it would show a white table cell with black text on it.

Can someone help me out with this ?

Thanks

Paul