function farbwert ($x, $x1, $y1, $x2, $y2){ return round(($y2 - $y1) / ($x2 - $x1) * $x + ( $y1 - (($y2 - $y1) / ($x2 - $x1)) * $x1 )); } $rot = 0; $gruen = 0; $blau = 0; if (isset($_POST['farbe_x'])) { $x = $_POST['farbe_x']; $rot = round(75 + $x / ( 600 / 180)); $gruen = round(136 + $x / ( 600 / 119)); $blau = round(246 + $x / (600 / 10)); //rot wird zum Testen mit der Formel errechnet $rotFormel = farbwert ($x, 0, 75, 600, 255 ); } ?>
| Tabellenzeile |