I am trying to change the color of text in a message box with a selection instead of a prompt, such as with this message box?

here is my working Javascript prompt

HTML
Code:
<div id="wysiwyg_cp" style="padding:8px; width:700px;">
  <input type="button" onClick="iForeColor()" value="Color" class='zip'>
 </div>

<textarea style='display:none;' name='message' id='message' cols='100' rows='14'></textarea>

<iframe name="richTextField" id="richTextField" style="border:#000000 1px solid; width:700px; height:300px;"></iframe>
Javascript:
Code:
function iForeColor(){
	var color = prompt('Define a basic color or apply a hexadecimal color code for advanced colors:', '');
	richTextField.document.execCommand('ForeColor',false,color);
}
I would like to use the image selection on this page - this is my working form, I've just added the paint bucket but don't know how to connect it to the text in the message box

Does anyone know of a tutorial that may help me??