");
break;
}
}
if(!Found)
alert("Sorry, the color '" + Item + "' is not listed in the " + "database.");
}
function reverseDatabase() {
var Found = false
var Item = document.forms[1].color.value
for(Count = 1; Count <= Idx[0]; Count ++) {
if(Item == Data[Count]) {
Found = true;
document.forms[1].result.value = Idx[Count]
break;
}
}
if(!Found)
document.forms[1].result.value = "No such Hex";
}
function viewReverse() {
if(!(document.forms[1].color.value) ) {
alert("Sorry, no color value specified.");
} else {
color = document.forms[1].color.value
win1 = window.open("","DisplayWindow","toolbar=no,width=300,height=200,directories=no,status=no,scrollbars=no,resize=no,menubar=no");
win1.document.write("");
win1.document.write("
");
win1.document.write("
");
}
}
// Cloaking Device Disabled -->
This code can be used for many differant types of applications.
Imagine having an online help, or a catalog with 1000's of items!
For this example, we used a library of colors. Simply enter a color into the textbox below
- depressing the 'submit' button will bring up an alert window giving the hex value of the
color (if it exists in the database). It will also bring up a small window with the
background as the color you requested.
Enter a hex value in the textbox. Do not include the "#" symbols and make sure the letter
values are in "CAPS". Hit submit and it will display the color's name in the box below.
Pressing 'view' will bring up a small window with the background as the color you requested.