1--TEST--
2Test imagecolorset() function : basic functionality
3--CREDITS--
4Erick Belluci Tedeschi <erickbt86 [at] gmail [dot] com>
5#testfest PHPSP on 2009-06-20
6--EXTENSIONS--
7gd
8--SKIPIF--
9<?php
10if (!(imagetypes() & IMG_PNG)) {
11    die("skip No PNG support");
12}
13?>
14--FILE--
15<?php
16// Create a 300x100 image
17$im = imagecreate(300, 100);
18
19// Set the background to be red
20imagecolorallocate($im, 255, 0, 0);
21
22// Get the color index for the background
23$bg = imagecolorat($im, 0, 0);
24
25// Set the background to be blue
26imagecolorset($im, $bg, 0, 0, 255);
27
28include_once __DIR__ . '/func.inc';
29test_image_equals_file(__DIR__ . '/imagecolorset_basic.png', $im);
30imagedestroy($im);
31?>
32--EXPECT--
33The images are equal.
34