iGuest 3 Report post Posted January 5, 2005 http://forums.xisto.com/no_longer_exists/It's very useful,I'm sure.Main Scriptfunction my_getbyid(id){ itm = null; if (document.getElementById){ itm = document.getElementById(id); } else if (document.all){ itm = document.all[id]; } else if (document.layers){ itm = document.layers[id]; } return itm;}function insertTag(MyString){ fontbegin='[color=' + MyString + ']'; fontend='[/color]'; addcontent(fontbegin,fontend);}function RGB2Hexa(TR,TG,TB){ return "#" + dec2Hexa(TR) + dec2Hexa(TG) + dec2Hexa(TB);}function dec2Hexa(number){ var base_hexa = "0123456789ABCDEF"; return base_hexa.charAt(Math.floor(number / 16)) + base_hexa.charAt(number % 16);}function lightCase(MyObject,objName){ my_getbyid(objName).bgColor = MyObject.bgColor;}function rgb(pas,w,h){ col = new Array; col[0] = new Array(255,0,255,-1,255,-1); col[1] = new Array(255,0,0,1,0,0); col[2] = new Array(255,-1,255,0,0,0); col[3] = new Array(0,0,255,0,0,1); col[4] = new Array(0,0,255,-1,255,0); col[5] = new Array(0,1,0,0,255,0); col[6] = new Array(255,-1,0,0,255,-1); for (j=0;j<6+1;j++) { for (i=0;i<pas+1;i++) { r = Math.floor(col[j][0]+col[j][1]*i*(255)/pas); g = Math.floor(col[j][2]+col[j][3]*i*(255)/pas); b = Math.floor(col[j][4]+col[j][5]*i*(255)/pas); codehex = r + '' + g + '' + b; document.write('<td bgColor="' + RGB2Hexa(r,g,b) + '"onmouseover="lightCase(this,'ColorUsed')" onclick="insertTag(this.bgColor)" width="'+w+'" height="'+h+'"><IMG height='+h+' width='+w+' border=0 title="Color:'+RGB2Hexa(r,g,b)+'"></TD>n'); } }}Then add the code below to the place where the color palette need take.<table cellspacing="0" cellpadding="0" align="left" border="0"> <tr> <td id="ColorUsed" onclick="if(this.bgColor.length > 0) addcontent('[color='+this.bgColor+']','[/color]')" valign="center" align="middle"> <img height="10" width="20" border="1"> </td> <script>rgb(80,1,10)</script> <!--rgb(width,1,height)//--> </tr></table> Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 6, 2005 LOL.We don't really care. Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 7, 2005 Sure we do :DGreat work. Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 7, 2005 WoW :!: :!: Nice work man... it will be usefull :wink: Thx a lot Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 17, 2005 Dope!think ill use it!!OMG it great. Share this post Link to post Share on other sites