Générateur couleur hexadécimal en ligne

Contenu du snippet

Je me décide à publier cette source (qui n'est pas au top mais bon .. :o) ) dans la continuité du script de site auto-généré que je développe en ce momment.
Il est compatible IE6.0 et N6.0 (merci à ronanry pour quelques renseignement javascript ;) => http://www.javascriptfr.com/article.aspx?Val=367 )

Ce script permet tout bêtement de voir les équivalences couleur <=> code hexadécimal en ligne.
La zone "Capture", permet de saisir un code hexadécimal (pour affiner la couleur souhaitée)

Visuel du script ici => http://script.blinckers-groups.com/color.php

Merci de laisser l'origine, si vous vous servez de ce script :o)

Source / Exemple :


<?
/********************************************

  • Générateur de couleur en Hexadecimal
  • Version 1.20 | 20/08/2002
  • BLINCKERS© Groups by Mcpeter
  • http://www.blinckers-groups.com
  • mcpeter@blinckers-groups.com
                                                                                        • /
/********************************************
  • GNU GPL (english)
  • This program is free software; you can
  • redistribute it and/or modify it under
  • the terms of the GNU General Public
  • License as published by the Free
  • Software Foundation; either version 2
  • of the License, or (at your option) any
  • later version.
                                                                                        • /
?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>BLINCKERS© Groups | Générer une couleur hexadécimale</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- body { background-color: #E5E5E5; scrollbar-face-color: #DEE3E7; scrollbar-highlight-color: #FFFFFF; scrollbar-shadow-color: #DEE3E7; scrollbar-3dlight-color: #D1D7DC; scrollbar-arrow-color: #006699; scrollbar-track-color: #EFEFEF; scrollbar-darkshadow-color: #98AAB1; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px} body,font,th,td,p { font: normal 10px Verdana, Arial, Helvetica, sans-serif } a,a:link,a:active,a:visited { text-decoration: none; color:#355274; font-weight: bold} a:hover {text-decoration: underline overline; color:#DD6900; font-weight: bold} --> </style> <script language="JavaScript"> <!-- // Script Macromedia Dreamweaver function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); // --> </script> </head> <body text="#000000"> <table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%"> <tr> <td align="center" valign="middle"> <form name="form1" method="" action=""> <table width="550" border="1" cellspacing="0" cellpadding="0" bgcolor="#E0DFE3"> <tr> <td align="center" valign="middle" class="tdDetailsChamp"> <table border="0" cellspacing="0" cellpadding="2"> <tr> <th><hr><h3 style="color:#355274">MyFirstSite© Color</h3><hr></th> </tr> <tr> <td class="tdDetailsChamp"> <ul type=\"square\"> <li>Passer la souris sur les zones colorées pour voir les codes couleur (Zone "Visuel" ).</li> <li>Selectionnez une couleur en cliquant dessus.</li> <li>Vous n'aurez plus qu'à sélectionner le code de la zone "Capture" et faire un copier/coller (Ctrl+c / Ctrl+v) de ce dernier où bon vous semble.</li> </ul> </td> </tr> <tr> <td align="center"> <table border="0" cellspacing="2" cellpadding="2" style="border: 2px inset #CCCCCC"> <tr> <td> <table border="0" cellspacing="0" cellpadding="0"> <? for ($n0 = 0 ; $n0 < 16 ; $n0++) { $h = $n0; if ($h > 9) { if ($h == "15") $h = "FF"; if ($h == "14") $h = "EE"; if ($h == "13") $h = "DD"; if ($h == "12") $h = "CC"; if ($h == "11") $h = "BB"; if ($h == "10") $h = "AA"; } else { $h = $h.$h; } $base = $h.$h.$h; echo "<tr>"; echo "<td bgColor=\"#".$base."\" width=15 style=\"cursor: pointer\" onmouseOver=\"javascript:form1.Affiche.value='#".$base."';Visu.bgColor=this.bgColor\" onClick=\"javascript:form1.KAffiche.value='#".$base."';KVisu.bgColor=this.bgColor\">&nbsp;</td>"; echo "<td width=5>&nbsp;</td>"; for ($n1 = 0 ; $n1 < 7 ; $n1 = $n1 + 3) { $h1 = $n1; if ($h1 > 9) { if ($h1 == "15") $h1 = "FF"; if ($h1 == "14") $h1 = "EE"; if ($h1 == "13") $h1 = "DD"; if ($h1 == "12") $h1 = "CC"; if ($h1 == "11") $h1 = "BB"; if ($h1 == "10") $h1 = "AA"; } else { $h1 = $h1.$h1; } for ($n2 = 0 ; $n2 < 16 ; $n2++) { //$h1 = $n1.$n1; $h2 = $n2; if ($h2 > 9) { if ($h2 == "15") $h2 = "FF"; if ($h2 == "14") $h2 = "EE"; if ($h2 == "13") $h2 = "DD"; if ($h2 == "12") $h2 = "CC"; if ($h2 == "11") $h2 = "BB"; if ($h2 == "10") $h2 = "AA"; } else { $h2 = $h2.$h2; } echo "<td bgColor=\"#".$h1.$h2.$h."\" width=10 style=\"cursor: pointer\" onmouseOver=\"javascript:form1.Affiche.value='#".$h1.$h2.$h."';Visu.bgColor=this.bgColor\" onClick=\"javascript:form1.KAffiche.value='#".$h1.$h2.$h."';KVisu.bgColor=this.bgColor\">&nbsp;</td>"; } } echo "</tr>"; } /*************************************************************************************/ for ($n0 = 15 ; $n0 >= 0 ; $n0--) { $h = $n0; if ($h > 9) { if ($h == "15") $h = "FF"; if ($h == "14") $h = "EE"; if ($h == "13") $h = "DD"; if ($h == "12") $h = "CC"; if ($h == "11") $h = "BB"; if ($h == "10") $h = "AA"; } else { $h = $h.$h; } $base = $h.$h.$h; echo "<tr>"; echo "<td bgColor=\"#".$base."\" width=15 style=\"cursor: pointer\" onmouseOver=\"javascript:form1.Affiche.value='#".$base."';Visu.bgColor=this.bgColor\" onClick=\"javascript:form1.KAffiche.value='#".$base."';KVisu.bgColor=this.bgColor\">&nbsp;</td>"; echo "<td width=5>&nbsp;</td>"; for ($n1 = 9 ; $n1 < 16 ; $n1 = $n1 + 3) { $h1 = $n1; if ($h1 > 9) { if ($h1 == "15") $h1 = "FF"; if ($h1 == "14") $h1 = "EE"; if ($h1 == "13") $h1 = "DD"; if ($h1 == "12") $h1 = "CC"; if ($h1 == "11") $h1 = "BB"; if ($h1 == "10") $h1 = "AA"; } else { $h1 = $h1.$h1; } for ($n2 = 0 ; $n2 < 16 ; $n2++) { //$h1 = $n1.$n1; $h2 = $n2; if ($h2 > 9) { if ($h2 == "15") $h2 = "FF"; if ($h2 == "14") $h2 = "EE"; if ($h2 == "13") $h2 = "DD"; if ($h2 == "12") $h2 = "CC"; if ($h2 == "11") $h2 = "BB"; if ($h2 == "10") $h2 = "AA"; } else { $h2 = $h2.$h2; } echo "<td bgColor=\"#".$h1.$h2.$h."\" width=10 style=\"cursor: pointer\" onmouseOver=\"javascript:form1.Affiche.value='#".$h1.$h2.$h."';Visu.bgColor=this.bgColor\" onClick=\"javascript:form1.KAffiche.value='#".$h1.$h2.$h."';KVisu.bgColor=this.bgColor\">&nbsp;</td>"; } } echo "</tr>"; } ?> </table> </td> </tr> </table> </td> </tr> <tr> <td> <br> <table border=0 align=center> <tr> <th colspan="2" style="border: solid 1px #333333">Visuel</th> <td width="50" bgColor="">&nbsp;</td> <th colspan="2" style="border: solid 1px #333333">Capture</th> </tr> <tr height="12"> <td> <input type="text" id="Affiche" name="Affiche" size="7" value="" style="border: none;background-color: #E0DFE3;"> </td> <td id="Visu" name="Visu" width="50" bgColor="" style="border: 1px inset #CCCCCC">&nbsp;</td> <td width="50" bgColor="">&nbsp;</td> <td> <input type="text" id="KAffiche" name="KAffiche" size="7" value="" onChange="javascript:KVisu.bgColor=form1.KAffiche.value;"> </td> <td id="KVisu" name="KVisu" width="50" bgColor="" style="border: 1px inset #CCCCCC">&nbsp;</td> </tr> </table> </td> </tr> <tr> <th> <hr><span style="font-size:9px"> Copyright© 2002-2003 - <a href="http://www.blinckers-groups.com\" target="_blank" style="font-size:9px\" title="Voir le site de l'auteur">BLINCKERS© Groups</a><br> MyFirstSite© Admin ver: 3.2<br> GenerateColor | version 1.2 | IE 6.0 - Net 6.0 </span> </th> </tr> </table> </td> </tr> </table> </form> </td> </tr> </table> </BODY> </HTML>

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.