Create Color for red, green and blue in PHP

Description

The following code shows how to create Color for red, green and blue.

Example


<?php//from  www  .  j  av  a  2  s .  com
     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);
?>

The code above generates the following result.

Create Color for red, green and blue in PHP




















Home »
  PHP Tutorial »
    Image »




Color
Create
Font
Operation
Shape
Text