| This is a code for making gradient background using PHP. PHP TEXT The code is set for a green-blue parameter to which you can add red by changing the number inside this line from 0 to 255, however the colors do not change much with a small change in the number, 10-20 for example.. $col=imagecolorallocate($image, 255, $g, $b); | |
| This is the gradient produced by setting the red at 0. | ![]() |
| Set at 100 | ![]() |
| set at 255 | ![]() |
| I got some further change by moving the 255 to another column. For example: $col=imagecolorallocate($image, $g, 255, $b); | |
| ($g, 255, $b); | ![]() |
| {$g, $b, 255); | ![]() |
| The code will not work if you change the background size to 300 or 400. At 500 it produces a tiling effect with four equal squares. | |