summaryrefslogtreecommitdiff
path: root/ext/gd/tests/imagecolorset_basic.phpt
blob: 3da518912808daff7effe6f321eab9e10ce47503 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--TEST--
Test imagecolorset() function : basic functionality
--CREDITS--
Erick Belluci Tedeschi <erickbt86 [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
if (!extension_loaded('gd')) {
    die('skip gd extension is not loaded');
}
?>
--FILE--
<?php
// Create a 300x100 image
$im = imagecreate(300, 100);

// Set the background to be red
imagecolorallocate($im, 255, 0, 0);

// Get the color index for the background
$bg = imagecolorat($im, 0, 0);

// Set the background to be blue
imagecolorset($im, $bg, 0, 0, 255);

include_once __DIR__ . '/func.inc';
test_image_equals_file(__DIR__ . '/imagecolorset_basic.png', $im);
imagedestroy($im);
?>
--EXPECT--
The images are equal.