PHP/Graphics Image/Image Color
Color: red, green and blue
<source lang="html4strict">
<?php
header("Content-type: image/gif"); $imgcord = imagecreate(250,300); $red = imagecolorallocate($imgcord, 255,0,0); $green = imagecolorallocate($imgcord, 0,255,0); $blue = imagecolorallocate($imgcord, 0,0,255); imageline($imgcord, 5,5, 125,50, $red); imagearc($imgcord, 100,25, 120,125, 0, 180, $green); ImagePNG($imgcord); ImageDestroy($imgcord);
?>
</source>
Create Color for paint
<source lang="html4strict">
<html> <body> <?php
$img=ImageCreate(200,200); $bgcolor=ImageColorAllocate($img,200,200,200); $pixelcolor=ImagecolorAllocate($img,255,0,0); ImageSetPixel($img,50,50,$pixelcolor); ImagePNG($img,"pic.png"); ImageDestroy($img);
?> <img src="pic.png" border=0> </body> </html>
</source>