Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Afficher la palette des couleurs RGB


{filelink=12664}

<html>
<head>
<title> Palette de Couleur</title>
</head>
<body>
<table>
<tr>
<?php
     $i = 1;
     $nombre_ligne = 18;

     for($rouge = 0; $rouge <= 5; $rouge++)
     for($vert = 0; $vert <= 5; $vert++) {
          for($bleu = 0; $bleu <= 5; $bleu++)
          {
               $rouge_hex = str_pad(dechex($rouge * 51), 2, "0", STR_PAD_LEFT);
               $vert_hex = str_pad(dechex($vert * 51), 2, "0", STR_PAD_LEFT);
               $bleu_hex = str_pad(dechex($bleu * 51), 2, "0", STR_PAD_LEFT);
               $couleur_hex = $rouge_hex . $vert_hex . $bleu_hex;

               print("<td bgcolor='#$couleur_hex' width='15'>&nbsp;</td>");

               if(($i %$nombre_ligne) == 0)
                    print("</tr><tr>");

               $i++;
          }
     }
?>
</tr>
</table>
</body>
</html>

No comments yet.

Leave a Comment