VMaxColorizer Applet

Do you sell items available in different colors?
OR do you want to play with image colors from a simple JavaScripts?

If yes, this applet is right for you !

Please, select color: 

 

How this works
One can specify unlimited number of image layers for the applet. Applet overlays them and draws the resulting image. Image listed first will be drawn first. Using transparent images allows to create very complex image.  Below is an example with only two layers IMAGE0 and IMAGE1.

<APPLET NAME="vmaxcolorizer" CODE=vmaxcolorizer.class WIDTH=504 HEIGHT=247>
<PARAM NAME="IMAGE0" VALUE="986a.gif">
<PARAM NAME="IMAGE1" VALUE="986b.gif">
<PARAM NAME="AUTHOR" VALUE="Virtual_Max (http://come.to/vmax)">
<PARAM NAME="KEY"    VALUE="Free Version">
</APPLET>
One can define as much layers as needed with "IMAGEi" param, the only limitation is that images enumerations starts with 0 and have no missed numbers.

The rest is done with calling of applet public methods from simple JavaScript.  Here is basic JavaScript code from this page source
Before calling of  applet colorize method one should test the browser allows to do this. Most of browsers can do this (Netscape 3 or higher and Microsoft Explorer 4 or better). But to avoid JavaScript errors one should check the browser version and vendor and check navigator.javaEnabled().
aname=navigator.appName;
aver =navigator.appVersion;
var brOK=false;
if( ((aname.indexOf("Netscape")!=-1)&&(parseInt(aver)>=3))
  ||((aname.indexOf("Explorer")!=-1)&&(parseInt(aver)>=4))
  ) brOK=true;
if(brOK){
   if(navigator.JavaEnabled)
     if(!navigator.JavaEnabled()) brOK=false; 
   else brOK=false; 
  }
Function setimagecolor is a simple JavaScript wrapper for applet public colorize(int imageN,int rgbColor)  method. The only reason why  you need wrapper is to test applet is already loaded and ready for work. For this purpouse wrapper checks the state of applet public boolean variable ready.
This function have two parameters : Number of image (layer) to apply filter and filter color. Filter color is hexadecimal integer in RRGGBB format same as HTML colors, and represents opacity coefficiens. Imagine you are looking on the image through colored glass. This parameter is the color of that glass.
function setimagecolor(nimage,color){
 if(brOK){
   if(document.vmaxcolorizer!=null){
      if(document.vmaxcolorizer.ready==true){
        col=parseInt(color+""); 
        document.vmaxcolorizer.colorize(nimage,col);
     }
   }
  } 
Last element is a  FORM with select.
<FORM>
 <SELECT onChange="setimagecolor(1,this.options[this.selectedIndex].value);">
  <OPTION value="0xffffff"></B>Silver
  <OPTION value="0x80ffff">Cyan
  <OPTION value="0xffff80">Yellow
  <OPTION value="0xff0000">Red
  <OPTION value="0x008000">Green
 </SELECT>
</FORM>
In above example onChange select handler gets the selected option color value and call setimagecolor function to change color of IMAGE1

Don't hesitate to look into this page HTML source for complete script.