Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // select color from palette, update onscreen bike and wall colors
- function color(r, g, b){
- var iefix;
- document.commands.output.value = "Choose a bike to display the required console commands";
- palr = r; palg = g; palb = b;
- for (i = 1; i <= 7; i++){
- biker = r;
- bikeg = g;
- bikeb = b;
- wallr1 = r * 14;
- wallg1 = g * 14;
- wallb1 = b * 14;
- wallr2 = r * 17;
- wallg2 = g * 17;
- wallb2 = b * 17;
- if ((i & 1) > 0){
- wallr1 = 210;
- wallr2 = 255;
- if (biker >= 1){
- wallr1 = 255;
- };
- if (biker == 15){
- biker = 0;
- };
- };
- if ((i & 2) > 0){
- wallg1 = 210;
- wallg2 = 255;
- if (bikeg >= 1){
- wallg1 = 255;
- };
- if (bikeg == 15){
- bikeg = 0;
- };
- };
- if ((i & 4) > 0){
- wallb1 = 210;
- wallb2 = 255;
- if (bikeb >= 1){
- wallb1 = 255;
- };
- if (bikeb == 15){
- bikeb = 0;
- };
- };
- biker *= 17;
- bikeg *= 17;
- bikeb *= 17;
- if(navigator.appName != "Microsoft Internet Explorer"){
- // firefox and other compliant browsers
- document.getElementById("bike" + i).setAttribute("bgcolor","#" + tohex(biker) + tohex(bikeg) + tohex(bikeb));
- document.getElementById("wall1" + i).setAttribute("bgcolor","#" + tohex(wallr1) + tohex(wallg1) + tohex(wallb1));
- document.getElementById("wall2" + i).setAttribute("bgcolor","#" + tohex(wallr2) + tohex(wallg2) + tohex(wallb2));
- }
- else{
- // internet explorer :(
- iefix = eval("document.all.bike" + i + ".style");
- iefix.backgroundColor="#" + tohex(biker) + tohex(bikeg) + tohex(bikeb);
- iefix = eval("document.all.wall1" + i + ".style");
- iefix.backgroundColor="#" + tohex(wallr1) + tohex(wallg1) + tohex(wallb1);
- iefix = eval("document.all.wall2" + i + ".style");
- iefix.backgroundColor="#" + tohex(wallr2) + tohex(wallg2) + tohex(wallb2);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement