require_once("../../critter_config.php");
require_once("../../critter_routines.php");
require_once("ip.php");
$ip_select = "SELECT ip_address FROM ip ORDER BY ip_timestamp";
$ip_select_result = mysql_query($ip_select, $db);
?>
IP Colour
$count=1;
while($ip = mysql_fetch_array($ip_select_result)) {
list($C,$M,$Y,$K) = explode(".",$ip['ip_address']);
$C = ($C/255);
$M = ($M/255);
$Y = ($Y/255);
$K = ($K/255);
$C1 = ($C*(1-$K)+$K);
$M1 = ($M*(1-$K)+$K);
$Y1 = ($Y*(1-$K)+$K);
$R = (255*(1-$C1));
$G = (255*(1-$M1));
$B = (255*(1-$Y1));
$Rhex = dechex($R);
$Ghex = dechex($G);
$Bhex = dechex($B);
$RGBhex = str_pad($Rhex, 2, "0", STR_PAD_LEFT) . str_pad($Ghex, 2, "0", STR_PAD_LEFT) . str_pad($Bhex, 2, "0", STR_PAD_LEFT);
?>
-
} ?>