有没有办法使用PHP动态地将十六进制颜色(#fffff)转换为一个小的.GIF图像?
答案 0 :(得分: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);
?>