ภาษาไทย
<!-- http://www.downcodes.com --> <!-- bbs http://www.downcodes.com/bbs--> <!--把如下代码加入到<body>区域中- -> <script language="JavaScript"> <!-- การซ่อน var red=0; var สีเขียว=0; var blue=0; ค่า var=0; var แปลง = อาร์เรย์ใหม่ () var hexbase = อาร์เรย์ใหม่ ("0", "1", "2", "3", "4", "5", "6", "7", "8", " 9", "A", "B", "C", "D", "E", "F"); สำหรับ (x=0; x<16; x++){ สำหรับ (y=0; y<16; y++){ แปลง[ค่า]= hexbase[x] + hexbase[y]; ค่า++; } } ฟังก์ชั่น clear(){ document.color.bl.value= blue; document.color.rd.value= สีแดง; document.color.gr.value=สีเขียว; } ฟังก์ชั่นการแสดงผล () { redx = แปลง [สีแดง] greenx = แปลง [สีเขียว] bluex = แปลง [สีน้ำเงิน] var rgb = "#"+redx+greenx+bluex; document.color.rgbdspl.value= rgb; document.bgColor =rgb; } ฟังก์ชั่น upred(x){ ถ้า ((red+x)<=255) red+=x document.color.rd.value= red; display() } ฟังก์ชั่น downred(x){ ถ้า ((red-x)>=0) red-=x document.color.rd.value= red; display() } ฟังก์ชั่น upgreen(x){ ถ้า ((เขียว+x)<=255) สีเขียว+=x document.color.gr.value= สีเขียว; display() } ฟังก์ชั่น downgreen(x){ ถ้า ((green-x)>=0) green-=x document.color.gr.value= green; display() } ฟังก์ชั่น upblue(x){ if ((blue+x)<=255) blue+=x document.color.bl.value= blue; display() } ฟังก์ชั่น downblue(x){ ถ้า ((blue-x)>=0) blue-=x document.color.bl.value= blue; display() } // ซ่อนเสร็จแล้ว --> </script> <form name="color"> <table align="center"> <tr align="Center"> <td width="52"> <input name ="red" type="button" value=" +50 " onClick="upred(50)"> </td> <td width="58"> <input name="red2" type="button" value= " + 10 " onClick="upred(10)"> </td> <td width="46"> <input name="red2" type="button" value=" + 1" onClick="upred(1) "> </td> <td width="52"><font color="#FF0000" size=+3><b><font color="#FA0000" face="楷体_GB2312">สีดำ</font ></b></font></td> <td width="46"> <input name="red-" type="button" value=" - 1" onClick="downred(1)"> < /td> <td width="58"> <input name="red-" type="button" value=" - 10 " onClick="downred(10)"> </td> <td width="52" > <input name="red-" type="button" value=" -50 " onClick="downred(50)"> </td> <td width="29"> <input type="text" name= "rd" size=3> </td> </tr> <tr align="Center"> <td width="52"> <input name="green" type="button" value=" +50 " onClick ="upgreen(50)"> </td> <td width="58"> <input name="green" type="button" value=" + 10 " onClick="upgreen(10)"> </td > <td width="46"> <input name="green" type="button" value=" + 1" onClick="upgreen(1)"> </td> <td width="52"><font color="#00FF00" size=+3><b><font color="#00FA00" face="楷体_GB2312">绿</font></b></font></td> <td width ="46"> <input name="green-" type="button" value=" - 1" onClick="downgreen(1)"> </td> <td width="58"> <input name=" สีเขียว-" type="button" value=" - 10 " onClick="downgreen(10)"> </td> <td width="52"> <input name="green-" type="button" value= " -50 " onClick="downgreen(50)"> </td> <td width="29"> <input type="text" name="gr" size=3> </td> </tr> < tr align="Center"> <td width="52"> <input name="blue" type="button" value=" +50 " onClick="upblue(50)"> </td> <td width= "58"> <input name="blue" type="button" value=" + 10 " onClick="upblue(10)"> </td> <td width="46"> <input name="blue" type="button" value=" + 1" onClick="upblue(1)"> </td> <td width="52"><font color="#0000FF" size=+3><b><font color="#0000FA" face="楷体_GB2312">蓝</font></b></font></td> <td width="46"> <input name="blue-" type=" ปุ่ม" value=" - 1" onClick="downblue(1)"> </td> <td width="58"> <input name="blue-" type="button" value=" - 10 " onClick= "downblue(10)"> </td> <td width="52"> <input name="blue-" type="button" value=" -50 " onClick="downblue(50)"> </td > <td width="29"> <input type="text" name="bl" size=3> </td> </tr> <tr align="Center"> <td width="52"> < /td> <td width="58"> </td> <td width="46"> </td> <td width="52"> <input type="text" name="rgbdspl" ขนาด=7 > </td> <td width="46"> </td> <td width="58"> </td> <td width="52"> </td> <td width="29"> < /td> </tr> </table> <div align="center"></div> <div align="center"></div> </form>