Because PHP's true color table parameters can only support 256, In order to display 8 colors or more ribbons, I used the parameter transfer method. The specific implementation code is as follows:
1. Program for generating ribbon graphics
Transition. php
<? Php
/*
* Function: generate a ribbon image
* Programmer: wlxz
* Date: 2002-00-00
*/
Header ("Content-type: image/Png ");
$ Im = ImageCreate (255, 50 );
$ Bgcolor = ImageColorAllocate ($ im, 0, 0, 0 );
$ X = trim ($ _ GET ['X']);
$ Y = trim ($ _ GET ['y']);
$ Z = trim ($ _ GET ['Z']);
For ($ I = 0; I I <255; $ I ++ ){
$ Fontcol = ImageColorAllocate ($ im, $ I * $ x, $ I * $ y, $ I * $ z );
ImageLine ($ im, $ I, 0, $ I, 50, $ fontcol );
}
ImagePng ($ im );
ImageDestroy ($ im );
?>
2. Call to generate multiple different images
View_color.php
<? Php
/*
* Function:
* Programmer: Xiang Li
* Date: 2002-00-00
*/
?>
<Html>
<Head>
<Title> </title>
<Meta name = "Author" content = "XIANG Li">
</Head>
<Body>
<Table>
<Tr>
<Td> <! -- Ribbon 1 -->
<Input type = "image" src = "./transition. php? X = 0 & y = 0 & z = 0 ">
</Td>
</Tr>
<Tr>
<Td> <! -- Ribbon 2 -->
<Input type = "image" src = "./transition. php? X = 0 & y = 0 & z = 1 ">
</Td>
</Tr>
<Tr>
<Td> <! -- Ribbon 3 -->
<Input type = "image" src = "./transition. php? X = 0 & y = 1 & z = 0 ">
</Td>
</Tr>
<Tr>
<Td> <! -- Ribbon 4 -->
<Input type = "image" src = "./transition. php? X = 0 & y = 1 & z = 1 ">
</Td>
</Tr>
<Tr>
<Td> <! -- Ribbon 5 -->
<Input type = "image" src = "./transition. php? X = 1 & y = 0 & z = 0 ">
</Td>
</Tr>
<Tr>
<Td> <! -- 6 -->
<Input type = "image" src = "./transition. php? X = 1 & y = 0 & z = 1 ">
</Td>
</Tr>
<Tr>
<Td> <! -- Ribbon 7 -->
<Input type = "image" src = "./transition. php? X = 1 & y = 1 & z = 0 ">
</Td>
</Tr>
<Tr>
<Td> <! -- Ribbon 8 -->
<Input type = "image" src = "./transition. php? X = 1 & y = 1 & z = 1 ">
</Td>
</Tr>
</Table>
</Body>
</Html>