<?php
header ("Content-type: image/png");
$image = imagecreate(500,300);


$bleu = imagecolorallocate($image, 0, 0, 100);
$bleu2 = imagecolorallocate($image, 130, 120, 100);
$bleuclair = imagecolorallocate($image, 156, 227, 254);
$noir = imagecolorallocate($image, 0, 0, 0);
$blanc = imagecolorallocate($image, 255, 255, 255);
$orange = imagecolorallocate($image, 255, 128, 0);


$heure=date('h');
$min=date('i');
$sec=date('s');

 imagestring($image, 4, 80, 15, "Il est $heure h $min minutes $sec secondes.", $blanc);
 
 $heure=$heure*10+30;
$heure_max=24*10+30;

 $min=$min*4+30;
$min_max=60*4+30;

 $sec=$sec*4+30;
$sec_max=60*4+30;

for ($i=0;$i<12;$i++){
$rand1=rand(0,300);
$rand2=rand(0,300);
$rand3=rand(1,50);
$rand4=rand(1,50);


ImageFilledEllipse ($image, $rand1, $rand2, $rand3, $rand4, $bleu2);
}


ImageFilledRectangle ($image, 30, 30, $heure_max, 50, $noir); //heures max
ImageFilledRectangle ($image, 30, 30, $heure, 50, $orange); //heures

ImageFilledRectangle ($image, 30, 80, $min_max, 120, $noir); //min
ImageFilledRectangle ($image, 30, 80, $min, 120, $blanc); //min

ImageFilledRectangle ($image, 30, 100, $sec_max, 120, $noir); //sec_max
ImageFilledRectangle ($image, 30, 100, $sec, 120, $blanc); //sec

imagepng($image);
?>





