This is a useful program since HTML Background colours are specified in Hex values (See later lectures). This HTML FORM/CGI script converts RGB numbers in range 0-155 to HEX values.
The HTML FORM:
<HTML> <HEAD> <TITLE>RGBtoHex: an RGB to Hexidecimal Color Converter</TITLE> </HEAD> <BODY> <H2>RGBtoHex</H2> <HR> <FORM METHOD=POST ACTION="http://www.cs.cf.ac.uk/User-bin/Dave.Marshall/rgb.pl"> <P>Please enter the RGB values for your color: <P>Red (0-255): <INPUT TYPE="text" NAME="red"><BR> Green (0-255): <INPUT TYPE="text" NAME="green"><BR> Blue (0-255): <INPUT TYPE="text" NAME="blue"><BR> <INPUT TYPE="submit" VALUE="Submit Values"><INPUT TYPE="reset" VALUE="Clear Values"> <HR> <ADDRESS> RGBtoHex was written by <A HREF="http://www.lne.com/lemay/">Laura Lemay</A> and <A HREF="http://www.lne.com/ericm/">Eric Murray</A> </ADDRESS>
and looks like this:
RGBtoHex converts standard RGB values (three 0 to 255 ASCII numbers indicating red, green, and blue), into a hexadecimal triplet that can be used for the background and text colors in Netscape 1.1b1 or in any other program that requires colors in this format.
RGB2toHex was written by Eric Murray and Laura Lemay, and is in the public domain. Feel free to install the source for this program on your own system (it requires the perl language and cgi-lib.pl) but please credit us for it (you can use the signature at the bottom of this form).