ファイル名 : colorpicker.html 要件 : Internet Explorer または Mozilla 作成者 : Jean-Luc Antoine 提出日 : 26/03/2005 カテゴリ : 4K 复制代幣代码如下: Couleur:Cliquez pour lister lesoeuvres les plus prochesde la Couleur選択名 <br><!--<BR>var total=1657;var X=Y=j=RG=B=0;<BR>var aR=新しい配列(合計);var aG=新しい配列(合計); var aB=new Array(total);<BR>for (var i=0;i<256;i ){<BR>aR[i 510]=aR[i 765]=aG[i 1020]=aG[i 5*255]=aB[i]=aB[i 255]=0;<BR>aR[510-i]=aR[i 1020]=aG[i]=aG[1020-i]=aB[i 510] ]=aB[1530-i]=i;<BR>aR[i]=aR[1530-i]=aG[i 255]=aG[i 510]=aB[i 765]=aB[i 1020]= 255;<BR>if(i<255){aR[i/2 1530]=127;aG[i/2 1530]=127;aB[i/2 1530]=127;}<BR>}<BR> function p(){var jla=document.getElementById('choix');jla.innerHTML=artabus;jla.style.backgroundColor=artabus;document.forms['recherche'].rgb.value=artabus}<BR>var hexbase=new Array("0","1","2","3","4","5","6","7","8","9","A"," B","C","D","E","F");<BR>var i=0;var jl=new Array();<BR>for(x=0;x<16;x )for(y=0;y<16;y )jl[i ]=hexbase[x] hexbase[y];<BR>document.write('<' 'table border="0" cellpacing="0" cellpadding="0" onMouseover="t(event)" onClick="p()">');<br>var H=W=63;<br>for (Y=0;Y s='<' 'tr height=2>';j=Math.round(Y*(510/(H 1))-255)<BR> for (X=0;X<=W;X ){<BR> i=Math .round(X*(合計/W))<BR> R=aR[i]-j;if(R<0)R=0;if(R>255||isNaN(R))R=255<BR> G=aG[i]-j;if(G<0)G=0;if(G>255||isNaN(G))G=255<BR> B=aB[i]-j;if(B< ;0)B=0;if(B>255||isNaN(B))B=255<BR> s=s '<' 'td width=2 bgcolor=#' jl[R] jl[G] jl[B] '><' '/td>'<br> }<br> document.write(s '<' '/tr>')<br>}<br>document.write('<' '/table>');<br>var ns6=document.getElementById&&!document.all<br>var ie=document.all<br>var artabus=''<br>function t(e){<br>source=ie?event.srcElement:e .target<br>if(source.tagName=="TABLE")return<br>while(source.tagName!="TD" && source.tagName!="HTML")source=ns6?source.parentNode:source. parentElement<br>document.getElementById('temoin').style.backgroundColor=artabus=source.bgColor<br>}<br>// --><br> 来源:http://www.interclasse.com/scripts/colorpicker.php