Color To VRML Format

[Total: 0    Average: 0/5]

This will convert from HTML color codes to VRML color codes.

Body Code:

<SCRIPT language="javascript">
function convert_H2V(input_num) {
  var x, new_num;
  if(input_num <= 'ff')
     x = parseInt(input_num, 16);
     new_num = x/255;

function convert (form) {
  form.VRMLred.value = convert_H2V(
  form.VRMLgreen.value = convert_H2V(
  form.VRMLblue.value = convert_H2V(

//end of script-->
<BR><FONT SIZE=+2>HTML to VRML color code converter</FONT>
<BR>This script converts hex codes to the proper float values to be used
in VRML.&nbsp;
<CAPTION><FORM name="color">







<TD><INPUT type="text" name="red" size="3"></TD>

<TD><INPUT type="text" name="green" size="3"></TD>

<TD><INPUT type="text" name="blue" size="3"></TD>

<TD><INPUT type="button" value="Convert" onclick="convert(this.form)"></TD>


<TD><INPUT type="text" name="VRMLred" size="5"></TD>

<TD><INPUT type="text" name="VRMLgreen" size="5"></TD>

<TD><INPUT type="text" name="VRMLblue" size="5"></TD>

<TD><INPUT type="RESET" value="Clear Form"></TD>


Times Viewed: 1

Leave a Reply

Your email address will not be published. Required fields are marked *