long MakeColor(int Red,int Green,int Blue)

    {

    // constrain to be proper size

    if(Red > 255) Red =255;

    if(Red<0) Red=0;

    if(Green > 255) Green=255;

    if(Green<0) Green=0;

    if(Blue > 255) Blue=255;

    if(Blue<0) Blue=0;

    Red*=65536; // add trailing zeros in hex (XX0000)

    Green*=256; // add trailing zeros in hex ( XX00)

    return(Red+Green+Blue);

}