Color Selector and RGB to Hex Converter



This is a script I wrote to help Web page authors select a color background for a Web page. The user inputs the background color as an RGB value and upon submission, the page is redrawn in that color. The script ensures that the text will appear by using the complement of the background color as the foreground or text color. An added benefit of this script is that the RGB value is displayed as a Hex value, thus it can be used as an RGB to Hex converter.
Here is a demo of the script in action.

Sample

Here is the source code. This perl script is free. You just need to tailor the base references to your site.

Source Code