Created
October 26, 2017 01:43
-
-
Save yoya/1252aee6b4dbb06ffa6ca693be00313e to your computer and use it in GitHub Desktop.
RYGB gradation Image Generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$width = 255; | |
$height = 4; | |
$im = imagecreatetruecolor($width, $height); | |
for ($x = 0 ; $x < $width ; $x++) { | |
$r = imagecolorallocate($im, $x, 0, 0); | |
$y = imagecolorallocate($im, $x, $x, 0); | |
$g = imagecolorallocate($im, 0, $x, 0); | |
$b = imagecolorallocate($im, 0, 0, $x); | |
imagesetpixel($im, $x, 0, $r); | |
imagesetpixel($im, $x, 1, $y); | |
imagesetpixel($im, $x, 2, $g); | |
imagesetpixel($im, $x, 3, $b); | |
} | |
imagepng($im); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment