This article mainly introduces how to use GD to achieve color gradient in php. The example analyzes the usage skills of GD library in php. For more information, see
This article mainly introduces how to use GD to achieve color gradient in php. The example analyzes the usage skills of GD library in php. For more information, see
This article describes how to use GD to implement color gradient in php. Share it with you for your reference. The specific implementation method is as follows:
<? Php $ im = imagecreate (255,255); $ bg = imagecolorallocate ($ im, 0, 0, 0); for ($ I = 255; $ I> = 0; $ I --) {$ color = imagecolorallocate ($ im, $ I); imagefilledrectangle ($ im, 0, $ I, 255, 1, $ color);} header ("Content-type: image/png"); imagepng ($ im); imagedestroy ($ im);?>
As follows:
I hope this article will help you with php programming.
,