[Ctrl A 모두 선택 참고: 외부 J를 도입해야 하는 경우 실행하려면 새로 고쳐야 합니다. ] var lightRGB = new Array(255,255,255); initColor("#0000FF"); function initColor(Color){ var opArray=new Array(.10,.25,.50,.75,1.0); var baseColor = longHexToDec(Color.substring(1,7)); var nColor,nHex; for(var i=0;i<5;i++) { nColor=setColorHue(baseColor,opArray[i],lightRGB); nHex = toHex(nColor[0])+toHex(nColor[1])+toHex(nColor[2]); document.all.item("marq").firstChild.firstChild.children(i).bgColor="#"+nHex; } } function setColorHue(originColor,opacityPercent,maskRGB) { returnColor=new Array(); for(w=0;w<originColor.length;w++) returnColor[w] = Math.round(originColor[w]*opacityPercent) + Math.round(maskRGB[w]*(1.0-opacityPercent)); return returnColor; } function longHexToDec(longHex) { r=toDec(longHex.substring(0,2)); g=toDec(longHex.substring(2,4)); b=toDec(longHex.substring(4,6)); return new Array(r,g,b); } function toHex(dec) { hex=dec.toString(16); if(hex.length==1)hex="0"+hex; if(hex==100)hex="FF"; return hex.toUpperCase(); } function toDec(hex) { return parseInt(hex,16); }