0

Is there any way to convert a hex color (#fffff) into a small .GIF image on the fly with PHP?

Michael Petrotta
  • 59,888
  • 27
  • 145
  • 179
StealthRT
  • 10,108
  • 40
  • 183
  • 342

1 Answers1

6

....

<?php
// create the image
$im = imagecreatetruecolor(100, 100);

// fill the image with the color you want
imagefilledrectangle($im, 0, 0, 99, 99, 0xFFFFFF);

// set the headers and output the image
header('Content-Type: image/gif');
imagegif($im);
imagedestroy($im);
?>

http://www.php.net/manual/en/function.imagegif.php

Saad Imran.
  • 4,480
  • 2
  • 23
  • 33