¾Æ·¡´Â º» ÀÚ¹Ù½ºÅ©¸³Æ® ¿øº»ÀÔ´Ï´Ù.
<html> <head> <title>ÇØÇÇCGI</title> </head> <body>
<h3 align="center"><font face="Verdana,Arial" color="#000099">Hex-to-RGB Conversion</font></h3>
<script language="JavaScript"> <!-- R = HexToR("#FFFFFF"); G = HexToG("#FFFFFF"); B = HexToB("#FFFFFF");
function HexToR(h) { return parseInt((cutHex(h)).substring(0,2),16) } function HexToG(h) { return parseInt((cutHex(h)).substring(2,4),16) } function HexToB(h) { return parseInt((cutHex(h)).substring(4,6),16) } function cutHex(h) { return (h.charAt(0)=="#") ? h.substring(1,7) : h}
//--> </script> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <td width="100%" align="center"><form name=rgb> <input type=text name=hex size=8 value="FFFFFF"> <input type=button name=btn value="Convert to RGB" onClick="this.form.r.value=HexToR(this.form.hex.value); this.form.g.value=HexToG(this.form.hex.value); this.form.b.value=HexToB(this.form.hex.value);"> <font color="red"><b>R:</b></font> <input type=text name=r size=3> <font color="green"><b>G:</b></font> <input type=text name=g size=3> <font color="blue"><b>B:</b></font> <input type=text name=b size=3> </form></td> </table> </body> </html>
|