Ralf: Farbverlauf

Hallo,

in jedem Malprogramm gibt es ein Feld, in dem so ziemlich alle Farben dargestellt sind. Meine Frage, wie errechnet man sowas?

Gruss

Ralf

  1. Du musst dir das als dreidimensionale Feld vorstellen.
    Die ROT,GRÜN,BLAU - Werte sind die Koordinaten.
    Und das ganze wird einfach zweidimensional dargestellt. Klingt kompliziert is es auch. *ggg*

    neeeeee, keine Ahnung! ;)))))))))

    Gruß
    DMIII

    1. Hi,

      ich hab hier sowas ähnliches in php, das eine Tabelle der 216 Netscape-Farben ausgibt. Ich hoffe, das hilft weiter:

      <table border="0" cellpadding="0" cellspacing="0">
      <tr>
      <?php
       for ($i=0; $i<216; $i++) {
           if ($i % 18 == 0) echo "</tr><tr>\n";
               $col = '#' . sprintf('%06x', ($i % 6) * 51 + floor(($i % 36)/6) * 13056 + floor($i/36) * 3342336);
           echo "\t<td style="background-color:$col"><img border="0" height="12" src="blind.gif" width="12" onclick="CloseDown('$col')"></td>\n";
       }
      ?></tr>
      </table>

      blind.gif ist natürlich ein unsichtbares gif.

      Viele Grüße,
      Jürgen