ipreg/image.php

16 lines
416 B
PHP

<?php
// get desired color
$color = $_GET['color'];
// create base image
$image = imagecreatetruecolor(6, 6);
// fill image with color
$color = imagecolorallocate($image, hexdec(substr($color,0,2)), hexdec(substr($color,2,2)), hexdec(substr($color,4,2)));
imagefill($image, 0, 0, $color);
// display image
header('Content-type: image/png');
imagepng($image);
imagedestroy($image);
?>